Padding on div border

前端 未结 6 1543
长发绾君心
长发绾君心 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:47

    Unfortunately, without adding another div, I don't think you can do this with just CSS.

    The more complicated your design gets, the more likely you will need extraneous html tags.

    Your other (also not great) option is an image background, or if it somehow makes you feel better, you can add elements client side with JQuery, thereby maintaining the "purity" of your server side files.

    Best of luck.

提交回复
热议问题