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 6041263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:38:10+00:00 2026-05-23T06:38:10+00:00

hi a i am triyng to using conditional css like this in my style

  • 0

hi a i am triyng to using conditional css like this in my style sheet

 div.box {  
     width: 400px;  
     [if IE 6] width: 600px;  
     padding: 0 100px;  
 }

i want to set a different width to my div in ie6 , so i am trying this code and not working , how can i set a different width in ie6

also i tried this in my style sheet

[if IE]
div.box {
         width: 600px;  
         padding: 0 100px; 
}
[endif]
  • 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-23T06:38:11+00:00Added an answer on May 23, 2026 at 6:38 am

    Conditional comments are for use inside HTML documents, not inside CSS files. IE’s HTML parser will interpret the rule inside the comment – as far as I know, there’s no equivalent logic in its CSS parser.

    The following code will work:

    <!--[if IE 6]>
    <style type="text/css">
    div.box {
             width: 600px;  
             padding: 0 100px; 
    }
    </style>
    <![endif]-->
    

    In most cases, it’s better to use the conditional comment to include an external stylesheet, rather than just wrapping a block of inline styles, like so:

    <!--[if IE 6]>
    <link rel="stylesheet" href="/css/IEpatches.css" type="text/css" media="screen" charset="utf-8"/>
    <![endif]-->
    

    Edited to specify IE6 only as requested in the question.

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

Sidebar

Related Questions

I am using conditional comments to link to a css file (let's call it
I'm trying to dynamically add a css stylesheet rule using javascript, something like example
I'm trying to calculate the conditional median of a chart that looks like this:
I'm trying to solve an IE CSS issue by using conditional tags. My jQuery
I wonder if anyone can work this HTML, CSS, Javascript puzzle out? I'm using
I'm trying to call WordPress's 'the_time' using a conditional statement that checks the category.
I'm trying to create an conditional Rewrite Rule using an .htaccess file and Apache.
I am using Oracle 11g client, with ODP.NET. I am trying to add conditional
How to set entire HTML in MSHTML? I am trying using this assignment: (Document
I've got a conditional compilation symbol I'm using called RELEASE, that I indicated in

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.