开发者

can a css border start away from the corner?

开发者 https://www.devze.com 2023-02-22 17:52 出处:网络
Is it possible to have css borders starting away from the corner of the parent element? I am in a situation where can\'t use padding to bring the width in because borders still go to the edge, and I

Is it possible to have css borders starting away from the corner of the parent element?

I am in a situation where can't use padding to bring the width in because borders still go to the edge, and I can't u开发者_如何学编程se margin because I need the background colour to go to the edge.

I would really rather avoid another parent div if possible.


There isn't an alternative. You will need to use another parent div.


not possible - you will have to bite the bullet and spend another tag on your page


If you don't want to add the extra markup, get the design to a place you think is ok, then add the extra divs with JavaScript.


It's worth noting that this can be done with pseudo elements, but this was not appropriate as I needed xBrowser compatibility.

0

精彩评论

暂无评论...
验证码 换一张
取 消