15
16

More than 5 years have passed since last update.

block / inline-block / inline 違い 

Posted at

block要素

・親要素の内容幅の全体に広がって配置される。

p div table ul ol form h1~h6 hr

inline要素

・書式設定・強調など文中の一部分にだけの使用される。
・block要素の中にインライン要素を配置することはできるが、逆はできない。

span a strong

inline-block要素

・inlineでありながら横幅や縦幅の指定ができる。
・html上の改行も反映して隙間が空いてしまうため、
間はコメントアウトしておく。

img input button

15
16
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
15
16