jfinner1
11-16-2009, 12:57 PM
I have two div, nested one inside the other. One needs to be width: 80%, and the other needs to be 46 pixles smaller then that, centered. I'm not exactly sure how to achieve this. I was thinking to use padding or margins, 23px left and right, but I'm not sure which would be better, or which div I should put it in.
HTML:
<div id="header">
<img src="http://jfinner1.co.cc/images/scrollleft.gif" align="left" alt="Scroll">
<div id="headertext">
Title Goes Here
</div>
<img src="http://jfinner1.co.cc/images/scrollright.gif" align="right" alt="Scroll">
</div>
CSS:
#header{
height: 100px;
width: 80%;
position: absolute;
top:20px;
left: 200px;
z-index: 1;
}
#headertext{
background: url("images/scrollbg.gif");
position: absolute;
top: 0px;
width: 100%;
height: 100px;
text-align: center;
z-index: 1;
font-size: 30px;
line-height: 100px;
}
HTML:
<div id="header">
<img src="http://jfinner1.co.cc/images/scrollleft.gif" align="left" alt="Scroll">
<div id="headertext">
Title Goes Here
</div>
<img src="http://jfinner1.co.cc/images/scrollright.gif" align="right" alt="Scroll">
</div>
CSS:
#header{
height: 100px;
width: 80%;
position: absolute;
top:20px;
left: 200px;
z-index: 1;
}
#headertext{
background: url("images/scrollbg.gif");
position: absolute;
top: 0px;
width: 100%;
height: 100px;
text-align: center;
z-index: 1;
font-size: 30px;
line-height: 100px;
}