CNT Posted August 15, 2011 Share Posted August 15, 2011 <head> <title>Hey</title> <link rel="Shortcut Icon" href="images/favicon.ico" /> <link rel="stylesheet" type="text/css" href="style.css" /> <style type="text/css"> background-image:url("images/saw.jpg"); background-repeat:no-repeat; background-attachment:fixed; background-position:center; </style></head> What's wrong with above code?What I want to do is (just examples) :1 index.php page has no image10 pages have same image (the "saw.jpg")1 page have "screwdriver.jpg" image1 page have "hammer.jpg" imageLooks like I will have to use "Internal Style Sheet" on every HTML page. Kinda of defend my propose for using menu.php, but it's the only way to do it, right?Chuck Link to comment Share on other sites More sharing options...
Ingolme Posted August 15, 2011 Share Posted August 15, 2011 If each page has a different class on the <body> element, you can target the body of each page using its classname: <body class="index"> <body class="section1"> And the stylesheet: body.index { background-image: url(...);}body.section1{ background-image: url(...);} Link to comment Share on other sites More sharing options...
CNT Posted August 15, 2011 Author Share Posted August 15, 2011 If each page has a different class on the <body> element, you can target the body of each page using its classname:<body class="index"> <body class="section1"> I see... thank you so much!Quick question (beyond the point)... can I use ID instead of CLASS in this case? Just asking. I know ID is used only once per webpage. Link to comment Share on other sites More sharing options...
Ingolme Posted August 15, 2011 Share Posted August 15, 2011 Yes, anything, as long as you can target the element. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.