PDA

View Full Version : background image issues



hellssuperhero
Aug 19th, 2007, 02:18 PM
hello i have an issue with setting my background up properly, i want to have the background tile according to how much info is on each page... and i wanted the image to start like top:150 left:150... i cant get it to work properly when i put

<body background= image.gif position:absolute; top:150; left;150> doesnt work... so i tried setting up a div to call this into play...

<style type="text/css">
#bg {position:relative; top:150; left:150;}
</style>
<div id="bg">
<body background ="background.gif">
</div>


i also tried calling it with out a div threw the body and if i remember the image showed correctly but this time my page started over 150 x 150 px maby the image was just set as background tiled and wasnt even in the right spot i really dont know.... if any1 can please help me with this issue i would greatly appreciate the help... thank you...

srule_
Aug 19th, 2007, 04:30 PM
Change this:



<style type="text/css">
#bg {position:relative; top:150; left:150;}
</style>
<div id="bg">
<body background ="background.gif">
</div>


to this:


<style type="text/css">
body {
background: url(background.gif) no-repeat 150px 150px;
}
</style>


Easy fix :thumbsup:

hellssuperhero
Aug 19th, 2007, 05:15 PM
thanks...
hey im just wondering whats up with the 150px; 150px instead of top:150px left:150px; i noticed if i put top and left infront of your code it alters the image location so what is the defualt for if you just say 150px 150px and does unspecified readjust unlike top 150 left 150 where regardless of the users window or screen size it will always be that many spots over ?

abduraooft
Aug 19th, 2007, 05:27 PM
thanks...
hey im just wondering whats up with the 150px; 150px instead of top:150px left:150px; i noticed if i put top and left infront of your code it alters the image location so what is the defualt for if you just say 150px 150px and does unspecified readjust unlike top 150 left 150 where regardless of the users window or screen size it will always be that many spots over ?

top and left are not for positioning background. They are for positioning an absolutely positioned element.http://www.w3schools.com/css/css_positioning.asp

Have a look at http://www.w3schools.com/css/css_background.asp for various background styling methods .

You can see the other related info as well!

hellssuperhero
Aug 19th, 2007, 05:46 PM
thank you...