
05-02-2005, 10:13 AM
|
|
SEO Junior
|
|
Join Date: Jan 2005
Posts: 24
|
|
You can use a CSS trick called the broken box model hack, which basically consists of using valid CSS code, followed by invalid CSS code. The valid code will set the widths/heights for all browsers, and then compliant browsers like Firefox will skip the invalid code, while browsers that accept invalid code (like IE) will read it, reseting the widths/heights for IE users.
Code:
/* all browsers read this valid code */
ul#mylist li{
text-decoration: none;
display: block;
width: 110px;
padding: 3px;
color: #333333;
font: bold 12px/1.5 verdana, arial, san-serif;
padding-left: 2px;
}
/* compliant browsers ignore this invalid code, IE reads it */
* ul#mylist li {
text-decoration: none;
display: block;
width: 110px; /*for ie5.x win */
w\idth: 110px; /*for ie6*/
padding: 3px;
color: #333333;
font: bold 12px/1.5 verdana, arial, san-serif;
}
|