Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with CSS and Backgrounds

Status
Not open for further replies.

SSonnier

Technical User
Nov 4, 2003
78
US
I am trying to use css to put a no repeating background on a site.
I have a file style.css that contains the following

background {
background-image: url(images/background.gif);
background-repeat: no-repeat;
background-position-x: center;
background-position-y: center;
}

The background image does not show in IE 5.5 or Netscaoe 6.0. I've even tried putting it in the header. Any idea of what I'm doing wrong? I know this must be simple.

Thanks!!!
 
redefine the body tag,

body {
background-image: url(images/background.gif);
background-repeat: no-repeat;
background-position: center center;
}



Chris.

Indifference will be the downfall of mankind, but who cares?
 
faq215-2573

check out the Fak

Listen All I ask is that You close out a Post You Started!!!!
 
no need for FAQ
just some logic here

background-position: left top;

much like u would use a cell to allign things inside of it...limiting since u can't adjust position to its "perfection"

while

background-position-x: should be a value in pixels;
background-position-y: should be a value in pixels;
based on coordinate system.
OR just in place both coordinates in one line
eg.
Code:
background-position: 330px 200px;

gives more freedom to image adjustements .....browsers you mentioned process it just fine.
HTH

All the best!

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top