views:

47

answers:

2

I need to add this background to a website and this is the criteria. I'm not sure what the right codes are, everything I try the background won't appear. Do I need to make a div or do I just put this info in the style section.

Body tag The path to the background image is images/grunge2.jpg and it’s position is -40px and 0px. The font family used is Verdana at 12px. The padding at the top is 20px.

Thanks

A: 

hi, if you spend some time to search you'll find it, but this is like:

file .css

  `body{

background-image:url(images/grunge2.jpg);

padding-top:20px;

font-size:12px;

}`

inline: <body style:" background-image:url(images/grunge2.jpg);padding-top:20px;font-size:12px;">

TiagoMartins
A: 

Notice the following would apply to the body tag also, usually the first node of <body> is a <div> container like:

<div id="containerDiv">
   ...
     page content
     ...
</div>

Than you can add add a background image in your CSS like :

#containerDiv{
   background-image:url('images/bgImage.jpg');
   //more css properties...
}
Babiker