背景图片可以延伸到div的边框之外吗? [英] Can background image extend beyond div's borders?

查看:209
本文介绍了背景图片可以延伸到div的边框之外吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景图片是否可以延伸到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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆