HTML width messed up by border

后端 未结 2 676
猫巷女王i
猫巷女王i 2021-01-24 19:05

HTML/CSS novice here.

Trying to put into practice what I\'ve learned on Codeacademy and I\'m stuck with an issue where my header which is set to width:100% ends up going

2条回答
  •  伪装坚强ぢ
    2021-01-24 19:49

    You could use box-sizing: border-box to calculate the width and height of the box including the paddings and borders.

    Also, you could use * { box-sizing: border-box } on everything. as suggested by Paul Irish.

提交回复
热议问题