1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【CSS】特定のブラウザに反映させる

Posted at

特定のブラウザのみにスタイルシートを適用したい時に使用します。
@mixinでまとめて、このコードを呼び出したい時は@includeで書きます。

#IE

style.scss
@mixin IE11 {
  @media all and (-ms-high-contrast: none) {
    @content;
  }
}

style.css
@include IE11 {
ここIEに反映させたいcssコードを書きます
}

以下も@includeの書き方は同じ。

#Firefox

style.scss
@mixin firefox {
  @-moz-document url-prefix() {
    @content;
 }
}

#Chrome

style.scss
@mixin chrome {
  @media screen and (-webkit-min-device-pixel-ratio:0) {
    @content;
  }
}
1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?