Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3443608
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:48:44+00:00 2026-05-18T08:48:44+00:00

What would be the CSS conditional statement you can use to include specific CSS

  • 0

What would be the CSS conditional statement you can use to include specific CSS for IE, Mozilla, Chrome.

If IE  
#container { top: 5px; }  

If Mozilla 
#container { top: 7px; }    

If Chrome  
#container { top: 9px; }

What would be the respective ‘If’s’ ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:48:44+00:00Added an answer on May 18, 2026 at 8:48 am

    For that

    • You can scan user Agent and find out which browser, its version. Including the OS for OS specific styles
    • You can use various CSS Hacks for specific browser
    • Or Scripts or Plugins to indentify the browser and apply various classes to the elements

    Using PHP

    See

    • http://php.net/manual/en/function.get-browser.php
    • http://techpatterns.com/downloads/php-browser-detection-basic.php
    • http://techpatterns.com/downloads/php_browser_detection.php (contains JS also)

    Then then create the dynamic CSS file as per the detected browser

    Here is a CSS Hacks list

    /***** Selector Hacks ******/
    
    /* IE6 and below */
    * html #uno  { color: red }
    
    /* IE7 */
    *:first-child+html #dos { color: red } 
    
    /* IE7, FF, Saf, Opera  */
    html>body #tres { color: red }
    
    /* IE8, FF, Saf, Opera (Everything but IE 6,7) */
    html>/**/body #cuatro { color: red }
    
    /* Opera 9.27 and below, safari 2 */
    html:first-child #cinco { color: red }
    
    /* Safari 2-3 */
    html[xmlns*=""] body:last-child #seis { color: red }
    
    /* safari 3+, chrome 1+, opera9+, ff 3.5+ */
    body:nth-of-type(1) #siete { color: red }
    
    /* safari 3+, chrome 1+, opera9+, ff 3.5+ */
    body:first-of-type #ocho {  color: red }
    
    /* saf3+, chrome1+ */
    @media screen and (-webkit-min-device-pixel-ratio:0) {
     #diez  { color: red  }
    }
    
    /* iPhone / mobile webkit */
    @media screen and (max-device-width: 480px) {
     #veintiseis { color: red  }
    }
    
    
    /* Safari 2 - 3.1 */
    html[xmlns*=""]:root #trece  { color: red  }
    
    /* Safari 2 - 3.1, Opera 9.25 */
    *|html[xmlns*=""] #catorce { color: red  }
    
    /* Everything but IE6-8 */
    :root *> #quince { color: red  }
    
    /* IE7 */
    *+html #dieciocho {  color: red }
    
    /* Firefox only. 1+ */
    #veinticuatro,  x:-moz-any-link  { color: red }
    
    /* Firefox 3.0+ */
    #veinticinco,  x:-moz-any-link, x:default  { color: red  }
    
    
    
    /***** Attribute Hacks ******/
    
    /* IE6 */
    #once { _color: blue }
    
    /* IE6, IE7 */
    #doce { *color: blue; /* or #color: blue */ }
    
    /* Everything but IE6 */
    #diecisiete { color/**/: blue }
    
    /* IE6, IE7, IE8 */
    #diecinueve { color: blue\9; }
    
    /* IE7, IE8 */
    #veinte { color/*\**/: blue\9; }
    
    /* IE6, IE7 -- acts as an !important */
    #veintesiete { color: blue !ie; } /* string after ! can be anything */
    

    Source: http://paulirish.com/2009/browser-specific-css-hacks/

    If you want to use Plugin then here is one

    http://rafael.adm.br/css_browser_selector/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to allow the logged user to edit MediaWiki/Common.css without adding them
Possible Duplicate: Complex CSS selector for parent of active child How would I make
In the modern era of CSS, how would I create a pair of panels
Assuming the following directory structure, htdocs/ images/ css/ .htaccess system/ index.php ... I would
I would like to do something similar in CSS than BODY {color:red;} but in
I would like to know what are the best ways to organise CSS code
What would be the best way to write this old CSS using LESS? .paginationContainerTop
How would I implement this JQuery Round Corner Plugin for 2 CSS items? Here
Reading on another forum I've came across the world of CSS Frameworks. The one
Would it not make sense to support a set of languages (Java, Python, Ruby,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.