|
Location: Web development - HTML / CSS License: A Public Domain dedication CSS HacksPosted by Giulio BaiSome nice hacks to improve your stylesheet with |
Skill: IntermediatePosted: 08/12/2008Views: 657Rating: 0.00 /5Popularity: 0.00 |
| Sign Up to vote for this article |
Dealing with browser inconsistencies often makes up a majority of the work for a web designer. Sometimes there is no reasonable way to accomplish a desired layout in all major web browsers without the use of some special exception rules for certain layout engines.
The purpose of this article is to describe some of the CSS hacks, also called CSS filters, with the least significant potential consequences.
Their main purpose is to prevent IE to parse content that might break the design and/or functionality of the website.
Syntax is a s follows
Syntax is a s follows
CONDITION could be
IE: any versions of IElt or lte IE VERSION: IE VERSION is respectively lower or lower or equalgt or gte IE VERSION: IE VERSION is greater or greater or equal
The !important directive was not read by IE6 and below, while this hack has been fixed in IE7.
IE7 and below don't support media selectors in the @import directive.
IE7 and Firefox interpret the div[class|="hyphen-hack"] directive as one would expect. Opera does it differently: it splits up the attribute value by hyphens and only check the first part against the attribute selector value.
Putting empty comments wherever in the stylesheet will cause IE5 to misinterpret the line.
This is because IE versions prior to 6 treat /**/ as a opening or closing comment and therefore the instruction below will cancel the directive
IE is unable to parse child selectors properly.
This results in a "nice" hack that can be used in replacement of the !important directive.
Yeap! These are only some of the known CSS hacks, the ones that are considered most useful and common.
Others involve invalid CSS (and are thus disencouraged by most) or have very few applications (and thus aren't worth a mention here).
Have fun experimenting!
This article, along with any associated source code and files, is licensed under A Public Domain dedication
| Giulio Bai
| Location: |
Sign up to post message on the article message board!