wickford
08-17-2003, 10:45 PM
I have a problem with the width parameter of my CSS. I have a number of A tags inside a DIV that has a set width of 182px. That DIV is inside another DIV, which is relatively positioned.
The problem is with the A tags. I have set them a width of 100% to fill the inner DIV tag. But while in IE they properly position themselves to the end of the inner DIV, in Mozilla and Netscape they spill over. I am testing this on Windows.
I tried to change the width into pixels and ems, but in Mozilla they always spill over, so that is not the solution.
Please see the zip file that contains screenshots of the same web file but in different browsers. The picture of IE is what I want. The A tags have a navy blue background.
I would like to edit the CSS so that I don't need an IE version and an MZ version, as one version is much easier to handle.
Thanks in advance.
/* CSS FILE */
div.lmct{margin:9px;width:182px}
div.lmnu{background-color:#993333;border:1px solid red;color:white;margin-bottom:10px;
padding-bottom:3px;width:182px}
div.lmnu a{background-color:#333366;color:#66CC66;display:block;
font:11pt "Berlin Sans FB",serif;padding:1px 5px;
text-decoration:none;width:100%}
div.lmnu a:hover{background-color:#993333;color:#33CCFF}
div.lmnu a img{border:0px;height:16px;padding:0px 0px 3px 3px;
vertical-align:text-top;width:20px}
div.lmnu img{height:26px;width:182px}
<div class="lmct">
<div class="lmnu">
<img src="thisthat.bmp" width="182" height="26" alt="" />
<a href="#"><img src="off.gif" width="20" height="16" alt="" />Swap</a>
<a href="#"><img src="off.gif" width="20" height="16" alt="" />Swap</a>
<a href="#"><img src="off.gif" width="20" height="16" alt="" />Swap</a>
</div>
</div>
The problem is with the A tags. I have set them a width of 100% to fill the inner DIV tag. But while in IE they properly position themselves to the end of the inner DIV, in Mozilla and Netscape they spill over. I am testing this on Windows.
I tried to change the width into pixels and ems, but in Mozilla they always spill over, so that is not the solution.
Please see the zip file that contains screenshots of the same web file but in different browsers. The picture of IE is what I want. The A tags have a navy blue background.
I would like to edit the CSS so that I don't need an IE version and an MZ version, as one version is much easier to handle.
Thanks in advance.
/* CSS FILE */
div.lmct{margin:9px;width:182px}
div.lmnu{background-color:#993333;border:1px solid red;color:white;margin-bottom:10px;
padding-bottom:3px;width:182px}
div.lmnu a{background-color:#333366;color:#66CC66;display:block;
font:11pt "Berlin Sans FB",serif;padding:1px 5px;
text-decoration:none;width:100%}
div.lmnu a:hover{background-color:#993333;color:#33CCFF}
div.lmnu a img{border:0px;height:16px;padding:0px 0px 3px 3px;
vertical-align:text-top;width:20px}
div.lmnu img{height:26px;width:182px}
<div class="lmct">
<div class="lmnu">
<img src="thisthat.bmp" width="182" height="26" alt="" />
<a href="#"><img src="off.gif" width="20" height="16" alt="" />Swap</a>
<a href="#"><img src="off.gif" width="20" height="16" alt="" />Swap</a>
<a href="#"><img src="off.gif" width="20" height="16" alt="" />Swap</a>
</div>
</div>