Why does CSS not support negative padding?

前端 未结 7 1455
予麋鹿
予麋鹿 2020-11-30 01:26

I have seen this many a times that the prospect of a negative padding might help the development of CSS of certain page elements become better and easier. Yet, there is no p

7条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 01:52

    Padding by definition is a positive integer (including 0).

    Negative padding would cause the border to collapse into the content (see the box-model page on w3) - this would make the content area smaller than the content, which doesn't make sense.

提交回复
热议问题