tags:

views:

33

answers:

1

http://we-live.in/the%5Fsierra - Towards the bottom of the page I have a div which contains an image of grass. How can I get the grass image to be centered horizontally on the page?

ok i got it centered now i need to move it lower down on the page

thanks

+1  A: 

In your CSS, add the following

background-position:center top;

to the following:

#title{
  width:940;
  height:145px;
  display:block;
  background-image:url(images/header.jpg)
}

Additionally, you can also add the following

margin:auto;

But that may not be necessary if you are simply wanting the background image (the grass image) to be centered.

Jonathan Sampson
#title {background-image:url(imgs/new_neighborrow.png);background-position:center top;display:block;height:145px;width:940px;}i checked with firebug and its still to the left-- ill try the automargin-- thanks!
adam
That's the wrong `#title` declaration. Aren't you talking about the one that has `header.jpg` as the background?
Jonathan Sampson
ok i got it centered and identified the right declaration... but now if i try to put it at the bottom with the footer it messes everything up? thanks in advance not sure if the site is for this type of little stuff im just learning- ill be sure to read through the faq and best practices- thanks
adam
If the problem is fixed, you should accept my answer. If you have a new problem, you should create a new question :)
Jonathan Sampson
ok done- thanks
adam