We Recommend

CSS: The Definitive Guide CSS: The Definitive Guide
Provides you with a comprehensive guide to CSS implementation, along with a thorough review of all aspects of CSS 2.1. Updated to cover Internet Explorer 7, Microsoft's vastly improved browser, this new edition includes content on positioning, text wrapping (nowrap), lists and generated content, table layout, user interface, paged media, and more.


Posted By

Winkyboy on 01/14/08


Tagged

css conditional browser-based


Versions (?)


Who likes this?

7 people have marked this snippet as a favorite

Winkyboy
jonhenshaw
vilebender
stoker
snucko
rd3k
JimiJay


Conditional CSS for FF, IE7, IE6


Published in: CSS 


URL: http://www.cmsproducer.com/different-css--firefox-internet-explorer-7-IE-6-5

Set different values for an element based on browser (specifically, how the browser interprets the CSS). Definitions must be in order as shown below because newer definitions override existing.

The first setting will apply to all browsers.
The second setting (using a pound symbol, #) will only apply to Microsoft Internet Explorer. The third setting (an underscore, _ ) will only apply to IE browsers 6.0 and older.

  1. .sample {
  2. height: 15px;
  3. #height: 15px;
  4. _height: 21px;

Report this snippet 

You need to login to post a comment.