/    Sign up×
Community /Pin to ProfileBookmark

Conditional statements

How do I add conditional CSS comments in an external style sheet? eg. [[If IE 6]]

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@pyroJun 27.2004 — You don't. CSS is not a scripting language.

However, you can often use browser's ability (or in IE's case, disability :rolleyes? to understand certain CSS selectors, properties, etc. to send certain styles to certain browsers. The more you can avoid doing this, the better, though.
Copy linkTweet thisAlerts:
@IncaWarriorJun 27.2004 — only IE uses conditionals
Copy linkTweet thisAlerts:
@Ben_RogersJun 28.2004 — Well, depending on the type of conditions you want, you could print out a style sheet with [url=http://www.php.net/]PHP[/url] or some other server side language. Also CSS3 offers some dynamic pseudo classes, but that's only supported in actual browsers.
×

Success!

Help @nichalp spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...