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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Body Background CSS

Netscape BG Image Problem

Body Background CSS

by  deecee  Posted    (Edited  )
This will get your background image in the center of your page and will keep its position fixed so it does not scroll with the page

put this in between your head tags

<style type="text/css">
<!--
body {
background-attachment: fixed;
background-image: url(file);
background-repeat: no-repeat;
background-position: center center;
}
-->
</style>

you can change the position...the first one is horizontal and the second one is vertical so for left top it woul read

body {
background-attachment: fixed;
background-image: url(file);
background-repeat: no-repeat;
background-position: left top;
}


if you want it to tile just deleat the no- part...if you want it to tile only horizontally change no-repeat to x-repeat....y-repeat will tile vertically only

then if you want it to scroll change fixed to scroll

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top