Paul has stated in a more eloquent way what my concern was. Noonnope's solution , I think, is cleaner and more cross browser compatible but it is HARDLY client proof.. or even CMS proof. and that's why I had been looking for an alternative. Yeah the CSS hack is just that a hack, and as such it has it drawbacks. but I it is nice to have options for when the situation arises.
Going back to the CODE.. and I might get FLAMED for this... but the .3em correction is touchy. I did some torture tests : adding borders, trying to line up bg/images, changing the BODY text size. But based on the advice given I kept experimenting and came up with the following solution-- CSS only, of course:
Code:
ul {
background:#333;
margin:0;
padding:0;
font-size:1%; /* my 'asymptote' solution to font-size:0 problem!!! Gotta love math*/
/*as each font stack I tested seemed to have its own optimal letter-spacing and word-spacing values, i found it best to use a "specific" stack; sans , serif, or monospaced, font family can easily be reset later. */
font-family:Georgia, "Times New Roman", Times, serif;
/* the following values go best with the serif stack*/
letter-spacing:-.25em;
word-spacing:-.25em;
}
li {
padding:10px;
display:inline-block;
vertical-align:top;
background:#FFA500;
font-size:10000%;/* resets font-size to 100% of parent's parent--nice!*/
font-family:"what ever it was before", Arial, sans-serif;/* resets font fam*/
letter-spacing:0; /*spacing resets*/
word-spacing:0; /*spacing resets*/
}
It seems to work in: FF, O, and Saf and Chr. ( I am on a mac so I haven't tested IE... but i figure worst comes to worst.. it's a conditional comment fix)
== : )
Keep in mind, the font stack is just an ADDED safety, and normally I do typography CSS separately so, the reset doesn't even have much if any CSS overhead in actual applications
Bookmarks