Hi guys!
So I have this html:
Code:
<body>
<img src="http://www.webmaster-talk.com/images/logov3.png" alt="kingdm" width="182" height="97" style="position:absolute; top:10px; left:10px;" />
<div id="holder">
<div style="position:absolute; left:10px; width:10px; height:10px; border:1px solid white;"></div>
</div><!-- end holder -->
</body>
</html>
and this CSS:
Code:
* {
margin: 0;
outline:none;
}
html, body {
background-color:#000;
background-image:url('../../images/earth.jpg');
background-repeat:no-repeat;
background-attachment:fixed;
background-position:bottom right;
height: 100%;
text-align:center;
font-family:Helvetica, Verdana, Arial, sans-serif;
font-size:12px;
font-weight:bold;
color:#fff;
}
#holder {border:1px solid red;
margin:-100px auto 0 auto;
position:relative;
top:50%;
width:auto;
height:200px;
}
My question is why when I set #holder to width: auto, why does it stretch all the way across the screen? Does it have to do with relative positioning?
I need it to be auto width and not 100% of the browser.
It has to be positioned relatively because I am going to have divs inside of it that need to be position absolutely.
ALSO!!
how do you position a background image top AND center??
I'm trying background-position:top center; as per w3.org, doesn't work??
and yes, i'm using background-attachment:fixed; for firefox.
thanks!
Last edited by soap; 07-18-2008 at 01:18 AM..
|