开发者

can a css border start away from the corner?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜