开发者

Centering my Title DIV

开发者 https://www.devze.com 2022-12-15 00:14 出处:网络
ht开发者_开发百科tp://we-live.in/the_sierra - 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?

ht开发者_开发百科tp://we-live.in/the_sierra - 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消