Howdy,

NewB to CSS and have a background image set to show up on my html pages, and so it does...

body {
font-family: "Trebuchet MS", sans-serif;
background: #bbb url(../imageshtml/page_background.jpg);
margin: 0;
padding: 0;
}

This currently happens to all of my html pages, BUT I don't want it happen to one of them. I want one of them to have a different background image but I don't know how to give this one html page a different background image or make it an exception.


I tried adding a <div id="privacy"> </div> to the exception html page, both inside and outside of the <body> </body> tag.

Then in the CSS file I had this...

/* ===== Privacy Policy ===== */

div#privacy {
background: none;
}

OR

div#privacy {
background: url(../imageshtml/page_background2.jpg);
}


Nothing I do seems to be working.

Thanks for any help you can give!

k

Why don't you just give the body an id? Only call the id on the pages that you want the background.

#background {
background: #bbb url(../imageshtml/page_background.jpg);
}

Hi MagicMedia,

Much thanks for your reply.

Your response makes sense in theory :) what would that look like?

html
<body id="background">

css
body#background {
<!--add background code goes here-->
}

Much Thanks for your help!

k

MagicMedia you legend! It worked. Thanks Much!

k

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.