0
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

◆ CSS:地味に意外と使えるプロパティと関数

① calc関数(レスポンシブ時に大活躍)

・レスポンシブ稼働した時に「child_2」のwidthは自動調整される。
・flexで同様の設定もできる

hoge.css

.parent {
  width: 740px;
}
.child_1 {
  width: 200px;
}
.child_2 {
  width:calc(100% -200px);
}

② nth-of-type(n)(レスポンシブ時に大活躍)

hoge.css

.div content ul li :nth-of-type(3){
  color: #ff0000;
}
0
0
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
0
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?