Padding on div border

前端 未结 6 1545
长发绾君心
长发绾君心 2021-02-01 20:08

I want to put padding on a css border. Pull it inside a div, away from the edge. Is this possible using css (css3 is fine, webkit).

Here is the design.

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-01 20:49

    No, that's not possible. Padding, margin and border are all parts of elements, you can't give a border padding or a margin a border.

    Maybe if you post an example of what you're trying to do we can come up with alternate solutions?

    -update- Looking at your example I'm afraid it's still not possible, at least not with just one div. Im not a fan of divitis either, but the extra div probably is the best option in this case.

提交回复
热议问题