Okay, what I mean by an elastic div is one without a set width, but which expands and contracts based on browser size. I’m trying to center an image within that div but not having any luck. I’ve tried auto margins.
Here’s my code. Right now I have a 5% margin, which is just a workaround for the moment.
[CODE]#brand a{
height:130px;
width:489px;
top:35px;
background: transparent url(graphics/brand.jpg) no-repeat;
text-indent:-9999px;
position:absolute;
margin-left:5%;
overflow:hidden;
}
#brand a:hover {
background-position: 0 -130px;
}
And here’s the html. You’ll see it’s wrapped in content and content back, both of which don’t have set widths.
[CODE]<body>
<div id=”wrap”>
<div id=”head”><a href=”index.html”><h1>Blah</h1></a></div>
<div id=”metal”><h1>blah</h1></div>
<div id=”contentback”>
<div id=”content”>
<div id=”lhead”><h1>blah:</h1></div>
<div id=”rhead”><h2>blah</h2></div>
<div id=”tophead”><h2>blah</h2></div>
<div id=”brand”><a href=”index.html”><h2>blah</h2></a></div>
Help would be much appreciated. ?