背景图片可以延伸到div的边框之外吗? [英] Can background image extend beyond div's borders?
问题描述
背景图片是否可以延伸到div的边框之外?是否overflow:visible适用于此?
不,背景不能超出元素的边缘。 p>
overflow
样式控制元素在内容大于元素的指定大小时如何反应。
但是, div
中的浮动元素可以扩展到div之外,并且该元素可以有背景。但是,由于IE7和更早版本有一个错误导致 div
增长,而不是让浮动元素显示在其外部。
Can background image extend beyond div's borders? Does overflow: visible apply to this?
No, a background can't go beyond the edge of an element.
The overflow
style controls how the element reacts when the content is larger than the specified size of the element.
However, a floating element inside the div
can extent outside the div, and that element could have a background. The usefulness of that is limited, though, as IE7 and earlier has a bug that causes the div
to grow instead of letting the floating element show outside it.
这篇关于背景图片可以延伸到div的边框之外吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!