[thelist] NN4.x and IE4.x
Kristof Neirynck
k.neirynck at belgacom.net
Fri Jul 25 07:14:15 CDT 2003
rudy wrote:
>>I would like to hear your rant on "classitis" and "css hacks"
>
>
> thanks, i think ;o)
>
> "classitis" is using a class where you don't have to
I agree.
.classname a{}
Will produce much cleaner html than
a.classname{}
> "css hacks" are techniques which take advantage of certain foibles,
> peccadilloes, weaknesses and shortcomings of various browsers, in
> order to achieve something that otherwise would be difficult or impossible,
> for example, the same pixel-perfect layout in all browsers, taking into
> consideration their various interpretations of the box model, support for
> css2 and css3 properties, etc.
>
> i dislike css hacks, and the only one i've ever used is @import
>
> css hacks make a site difficult to modify -- if you are not intimately
> familiar with all the hacks used on the site, you daren't touch anything,
> lest it all fall down
>
> i mean, consider this --
>
> <style type="text/css">
> p.attention { background:yellow }
> i {content:"\"/*"}
> p.attention { background:lime }
> </style>
>
> what's a maintenance developer going to do with that, other than potentially
> mess it up?
You could add
/*
inline high pass filter hack
<http://www.tantek.com/CSS/Examples/inlinehpf.html>
*/
> note that "maintenance developer" includes yourself, a few months down the
> road after you've forgotten what you wrote and why...
>
> besides, needing to use a css hack is symptomatic of a deeper problem, which
> is usually the (often misguided) desire to make things look "the same" in
> all browsers
You can't possibly object to a box model hack as simple as the Tan hack?
/*
A Modified SBMH (Tan hack)
<http://www.info.com.ph/~etan/w3pantheon/style/modifiedsbmh.html>
uses the Star html Selector Bug
<http://www.info.com.ph/~etan/w3pantheon/style/starhtmlbug.html>
and CSS '\' escapes in selectors
<http://w3development.de/css/hide_css_from_browsers/more/>
*/
#someid{
border: 10px;
padding: 10px solid;
width: 100px; /* all browsers */
}
/* only ie will read this */
* html #someid{
width: 140px; /* ie5 */
w\idth: 100px; /* ie6 */
}
Kristof
More information about the thelist
mailing list