IE7 中的换行符上出现浮动
我需要一些帮助来尝试让浮动在 IE 中正确显示。 IE 想要在我尝试将其[箭头]向右浮动后添加换行符...
我希望它像 Firefox(右)一样显示,其中所有内容都适合一行,但我似乎无法弄清楚怎么样...
干杯。
background-image: url( '/img/arrow_down.gif' );
background-repeat: no-repeat;
height: 8px;
width: 15px;
display: inline;
float: right;
I need some help trying to get floats to display properly in IE. IE wants to add a newline after I try to float it [the arrow] to the right...
I would like it to display like Firefox (right), where it all fits in one line, but I can't seem to figure out how...
Cheers.
background-image: url( '/img/arrow_down.gif' );
background-repeat: no-repeat;
height: 8px;
width: 15px;
display: inline;
float: right;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
发布您的标记会有所帮助。造成这种情况的一个常见原因是标记中文本后面出现箭头。如果将箭头移到文本之前,它在两个文本中看起来都应该是正确的。就像:
当我第一次开始使用网页布局时,这对我来说听起来很奇怪,但我惊讶地发现它有效(现在我对
float
有了更好的理解,这对我来说有点意义)。不过,您也许可以使用这个更简单的标记:
还有 CSS:
Posting your markup would help. A common cause of this is the arrow appearing after the text in the markup. If you move the arrow to before the text, it should look right in both. Like:
When I first started with web layout, this sounded really weird to me, but I was surprised to find it worked (and now that I understand
float
a little better, it makes a little sense to me).You might be able to get away with this much simpler markup instead, though:
And CSS:
检查你的宽度,IE 会为 div 添加宽度。删除边距和填充将是一个好主意。
Check your widths, IE will add width to divs. Removing margin and padding would be a good idea.