Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Conditional comments explanations

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #45704
    Kuzyo
    Participant

    Saw on one site such comments

    Can’t understand how it works, before I have used this way

    Can somebody explain? Thanks in advance

    #139623
    CrocoDillon
    Participant

    Pretty much the same way. If condition is true, the html gets inserted into the document. In this case it’s a way to create a class on the html element to identify ie 8. You can then use it in css selectors like `.ie8 .someElement { … ie 8 specific styles … }`.

    #139625
    Kuzyo
    Participant

    if I want to use specific styles for IE 8 I write in my main css **.ie8 .box { … specific styles … }.** , but in HTML only **class = “box”** and IE8 add **class = “ie8″** to **”box”** automatically.
    Is this right, or I something misunderstood?

    #139628
    CrocoDillon
    Participant

    `.ie8 .box { … }`, correct so far. But the `.ie8` comes from the ``, it doesn’t get added to `.box`. It’s like when you do `html.ie8 .box { … }`, except without `html`.

    #139632
    Kuzyo
    Participant

    It seems simpler way for adding little correction for IE. Thanks @CrocoDillon for explanations

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.