gpt4 book ai didi

html - IE7 - 背景颜色太宽

转载 作者:太空宇宙 更新时间:2023-11-04 12:46:08 24 4
gpt4 key购买 nike

我在图片上有一些文字。

在新的浏览器中它工作正常。

但是当我在 IE7 中检查时,它看起来像这样: enter image description here

不知何故,IE7 非常热衷于为背景颜色提供 100% 的宽度。我不想通过设置宽度来修复它,因为文本的长度会因页面而异。

我的 CSS 看起来像这样:

#sub-slideshow-wrapper h2 {
font-family: 'Droid Sans',sans-serif;
display: table;
font-size: 20px;
font-weight: 900;
color: #000;
background: #e68e47;
background: rgba(230,142,71,0.8);
padding: 7px;
margin: 0 0 3px 0;
}

而且我知道 IE7 已经过时了,只有 1.xxx 可以使用它。但我希望它适用于所有浏览器,甚至是旧浏览器。

最佳答案

如果您必须支持 IE7,请添加 zoom:1 和 *display:inline(针对 IE6 和 7 的星号 hack)以使 IE 7 将它们显示为内联 block 。 然而,这可能会产生您不想要的其他效果。

#sub-slideshow-wrapper h2 {
font-family: 'Droid Sans',sans-serif;

zoom: 1; /* added */
*display: inline; /* added */

display: table;
font-size: 20px;
font-weight: 900;
color: #000;
background: #e68e47;
background: rgba(230,142,71,0.8);
padding: 7px;
margin: 0 0 3px 0;
}

关于html - IE7 - 背景颜色太宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26505025/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com