0
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.

SCSSを使って要素を横並びにする方法

Last updated at Posted at 2019-05-20

##やりたいこと
図の変更後のようにtableを横並びにしたい。

####変更前
Blank-4.png

####変更後
Blank-3.png

##手順
####① wrapper1に display: inline-block; を適用させる。
Blank-2.png

wrapper1 {
  display: inline-block;
}

####②全体の横幅を100%とした時、wrapper1とwrapper2を相対的に評価して幅を決める。
例)wrapper1 : wrapper2 = 3 : 7 にする
  wrapper1 の width: 30%;
  wrapper2 の width: 70%;

Blank-4.png

wrapper1 {
  display: inline-block;
  width: 30%;
}

wrapper2 {
 width: 70%;
}

####③ wrapper2に float: right;を適用させる。
これを適用させることで、wrapper1の横に, wrapperにが潜り込む。
Blank-3.png

wrapper1 {
  display: inline-block;
  width: 30%;
}

wrapper2 {
 width: 70%;
 float: right;
}
0
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
0
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?