1

Working with media queries, I need to be able to use the css keyword "initial". Unfortunalty it's not suported by Internet Explorer.

Could I replace it by "auto" on another keywork do work around this issue ?

/* visibility classes */
.hidden, .hidden-on-phone, .hidden-on-tablet {
  display: none;
}
@media (min-width: @tablet-screen) {
  .hidden-on-phone {
    display: initial; // not ie compliant
  }
}
@media (min-width: @desktop-screen) {
  .hidden-on-tablet {
    display: initial; // not ie compliant
  }
}
Seb
  • 85
  • 1
  • 9
  • According to http://www.w3.org/wiki/CSS/Properties/display there is no `display initial;` Try to define defaults like `div.initial { display: block; }` or try to use `display: inherit;` but the results will vary. – Nico O Jul 31 '14 at 11:01
  • 1
    @NicoO - In [CSS3CASCADE](http://www.w3.org/TR/2013/WD-css3-cascade-20130103/#initial) all properties have an `initial` value. CSS3CASCADE also proposes a `default` value to roll back all properties to their values at the start of the origin (e.g. author non-important styles) but that has outstanding issues and no implementations right now. – Alohci Jul 31 '14 at 11:16
  • @Alohci yes you are right. My comment was not thought through. As seen here: https://developer.mozilla.org/en-US/docs/Web/CSS/initial#Browser_compatibility you may use the `initial` property value in all browsers except IE. Is there any article on caniuse.com on this? Thank you for the clarification – Nico O Jul 31 '14 at 11:29
  • 1
    @NicoO I think there's noting on caniuse cause this is not in the css3 spec, it's just a proactive change from browser, and IE didn't jump into it, unfortunatly... – Seb Aug 01 '14 at 09:56

0 Answers0