[wp-hackers] Revised Login Form Complete!

Mike Borrelli mike at hitori.org
Mon Sep 11 18:00:11 GMT 2006


I agree, browser-sniffing, by way of checking the User Agent and such, is
a Bad Thing(tm), but that's not what's being done in this case.

>From the patch:
+       <!--[if IE]><style type="text/css">#login h1 a { margin-top: 35px;
} #login ul { padding-bottom: 65px; }</style><![endif]--><!-- Curse you,
IE! -->

In Safari, Firefox, Oprah, etc... this is just a pair of normal, well
formed, HTML comments.  In Internet Explorer, however, it parses it and
includes the extra style tag.

No browser sniffing involved.  All clients get the same data, they just
process it differently.

Cheers,
Mike

>>> ... I'd much rather have a conditional comment for IE, so that
>> I agree, I think that browser specific stylesheets are a great way to
>> handle this. It keeps the main stuff clean and only burdens browsers that
>> don't behave properly. *Much* better than mucking up the CSS with a bunch
>> of hacks.
>
> That's generally frowned upon since it requires browser-sniffing (which is
> bad).
>
> "Hacking" doesn't always have a negative connotation.  Hacks to handle
> browser-specific exceptions are well-known and well-documented, and
> generally add only a few bytes to a stylesheet.  The CSS wiki also points
> to
> (sometimes tricky) ways to avoid browser-specific CSS hacks.
>
> -- Charles
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>




More information about the wp-hackers mailing list