gpt4 book ai didi

html - 无法在 IE 6 中将图像 float 到文本的右侧

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

我正在尝试为站点创建类似 div 的小咆哮。它在 Firefox 中运行良好,但在 IE6 中却不行(没有尝试过 IE7,但我仍然需要支持 IE6)。

在 Firefox 中:居中文本,图像 float 到 div 的右侧在 IE6 中:文本居中,图像位于文本左侧。

我已经尝试切换 img 和 span 标签的顺序,但这会导致两者之间的 FF 换行,并且 IE 将图像呈现在文本的右侧,但不会停靠在 div 的右侧。

HTML

<div id="growl">
<img src="close.gif" class="action" title="hide" />
<span class="text">Grrrrrr.......</span>
</div>

在 CSS 中:

#growl {
background-color:yellow;
text-align:center;
position:absolute;
top:0; left:0;
width:98%;
padding:10px 0;
margin-left:1%;
z-index:10;
border:1px solid #CCCCCC;
}

#growl > .text {
font-size:120%;
font-weight:bold;
}

#growl > .action {
float:right;
cursor:pointer;
}

最佳答案

> 选择器在 IE 6 上不起作用。

只是摆脱它:

#growl .text {
font-size:120%;
font-weight:bold;
}

#growl .action {
float:right;
cursor:pointer;
}

关于html - 无法在 IE 6 中将图像 float 到文本的右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/727675/

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