Set div outerwidth using css

后端 未结 5 685
名媛妹妹
名媛妹妹 2021-01-02 00:48

I wonder if there is way to set outerwidth of a div using css to ignore padding and borders.

When I set a div t

5条回答
  •  暖寄归人
    2021-01-02 01:21

    Nest another div inside yours, and apply the paddings/borders to the nested one:

    ....

    Unfortunately, there is no purely CSS way to achieve that (or at least I'm not aware of one).

提交回复
热议问题