LoginSignup
1
1

More than 1 year has passed since last update.

widthとheightが反応しない原因

Last updated at Posted at 2021-11-16

横と高さを指定してるのに有効にならない時があります。


原因は
1つめ   aのタグをつかっているとき
2つめ   spanのタグをつかっているとき


これらのタグはインライン形式になってます。
インライン形式にはwidthとheightが反応しません。


なので
インラインブロック形式に変えてあげれば高さと横を指定することができます。


この記述でインライン属性からインラインブロック属性になります。
display: inline-block;


これで高さと横を指定することができるようになります。

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