图例不会在IE7上向左浮动 [英] Legend doesn't float left on IE7

查看:90
本文介绍了图例不会在IE7上向左浮动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IE7上遇到问题.我有以下html格式.

I am having trouble on IE7. I have following html format.

<fieldset class="wrapper">
    <legend class="ct">Legend </legend>
    <div class="ct">Div 1</div>
    <div class="ct">Div 2</div>
</fieldset>

这是CSS样式

.wrapper .ct {
    display:inline-block;
    *display:inline; /*IE7*/
    float:left
}

当我在其他浏览器上对此进行测试时,它可以正常工作,但IE7不能.请参见下面的屏幕截图.但是,如果我使用div而不是legend,那么它将起作用.这是 Jsfiddle

when I test this on other browser it works fine but IE7 does not. Please see screenshot below. But if I use div instead legend then it works. Here is on Jsfiddle

推荐答案

安德烈斯(Andres)几乎拥有了它.在"float:left"之后添加"* float:none",您应该会很好.

Andres almost had it. Add a "*float: none" after the "float: left" and you should be good.

.wrapper .ct {
    display:inline-block;
    float:left;
    *display:inline;
    *float:none;
}​

这是更新的小提琴

这篇关于图例不会在IE7上向左浮动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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