2
2

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.

max-width と mix-width の使い方

2
Posted at
Page 1 of 2

簡単にいうとこういうことだ!

要素の最大値と最小値を決める

どんな時に使うか

レスポンシブ(スマホ対応)させるときに使いましょー

使い方

  • スマホは100%だと調子いいけど、PCで100%はデカすぎるー。

そんな時は、最大値を決めよう!

code
width: 100%;
max-width: 500px;

これで、100%だとしても、500px以上になりません!

  • スマホは50%だときついけど、PCで50%がいいんだよなあ。。

そんな時は、最小値を決めよう!

code
width: 50%;
min-width: 250px;

これで、いくら狭くしても250px以下になりません!

2
2
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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?