Skip to content

Hide styles from IE6 - IE11 (@media only + nested @media rules) #6

@WebMechanic

Description

@WebMechanic

The only keyword was introduced in MQ4 afaik to blockout old UAs from choking on the new stuff.

@media only all {
  /* invisible for IEs */
}

Also works as <link media="only all" href="not-for-ie.css"> to prevent IE8- to load external stylesheet - as do all @media rules.

Nested @media rules

@media all {
  /* visible to IEs */
  @media (min-width:1px) {
    /* nested: invisible to IEs */
  }
}

EDIT: as discovered in the discussion below "only" only works up to IE8, but nested queries do filter newer version of IE. For MSIE11 see #9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions