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.

要素を横並びにする

Last updated at Posted at 2020-08-08

HTMLで記述した要素は基本的に縦に並んでいくので、横並びにするにはCSSでの指定が必要です。

#floatプロパティ
floatプロパティを用いることで、指定した要素を横並びにすることができます。
float: left;を指定すると要素が左から順に横に並びます。
float: right;を指定すると要素が右から順に横に並びます。

index.html
<ul>
  <li>アイテム1</li>
  <li>アイテム2</li>
  <li>アイテム3</li>
</ul>
style.css
li {
  float: left;
}
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?