1
1

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 5 years have passed since last update.

bootstrap4 scss ブレークポイント(sm mdとか)ごとにデザイン変更

Posted at

スマホは背景白、それ以外は背景赤。とかやりたい。

参考:https://www.webdesignleaves.com/pr/plugins/bootstrap4_01.html

hoge.scss
@import "~bootstrap/scss/bootstrap";

@include media-breakpoint-down(sm) {
  .card {
    background-color: white;
  }
}

@include media-breakpoint-up(md) {
  .card {
    background-color: red;
  }
}

結果

bootstrapとscssって便利よな。gif、動きます。

a.gif

1
1
0

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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?