Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/401.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
与IE9和浮动div对齐的CSS问题_Css_Internet Explorer 9_Css Float - Fatal编程技术网

与IE9和浮动div对齐的CSS问题

与IE9和浮动div对齐的CSS问题,css,internet-explorer-9,css-float,Css,Internet Explorer 9,Css Float,我遇到了一个问题,我有一个左浮动div,其中有一个图像,然后在右边有一堆几个div。在兼容模式下,它在FF、Chrome和IE9中显示良好,但在正常IE9中查看时,最底部的div会被推到图像下方 左分区: { float: left; clear: both; margin-right: 10px; } 在IE9上出现的右div one: width: 350px; float: right; margin-left: 10px; height: 150px; overflow: hidde

我遇到了一个问题,我有一个左浮动div,其中有一个图像,然后在右边有一堆几个div。在兼容模式下,它在FF、Chrome和IE9中显示良好,但在正常IE9中查看时,最底部的div会被推到图像下方

左分区:

{
float: left;
clear: both;
margin-right: 10px;
} 
在IE9上出现的右div one:

width: 350px;
float: right;
margin-left: 10px;
height: 150px;
overflow: hidden;
以下是IE9中的情况:

以下是它在Chrome或FF中的外观:

请尝试为您的左div指定一个宽度?并确保总数加起来-

请试着给你的左div一个宽度?并确保总数加起来-

我认为这是一个明确的修复问题。我也时常遇到这些问题。解决方法是总是添加一个新元素,即所谓的伪元素,以便正确渲染。所以

/**
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    contenteditable attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that are clearfixed.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */
.cf:before,
.cf:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.cf:after {
    clear: both;
}

/**
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */
.cf {
    *zoom: 1;
}
这里是你的内容

它来自


我希望这能为您解决问题,让我知道。

我认为这是一个明确的解决问题。我也时常遇到这些问题。解决方法是总是添加一个新元素,即所谓的伪元素,以便正确渲染。所以

/**
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    contenteditable attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that are clearfixed.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */
.cf:before,
.cf:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.cf:after {
    clear: both;
}

/**
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */
.cf {
    *zoom: 1;
}
这里是你的内容

它来自

我希望这能帮你解决问题,让我知道。

有三件事要做

指定左、右div所在容器的总宽度。 将宽度指定给左侧宽度。这样右div的文本就不会合并在一起。 将clr类的另一个div放在right div之后,以便清除左div和右div所在容器中的浮动。 例如:

它适用于所有浏览器

请记住,左/右刻度的总宽度不应超过容器。

要做三件事

指定左、右div所在容器的总宽度。 将宽度指定给左侧宽度。这样右div的文本就不会合并在一起。 将clr类的另一个div放在right div之后,以便清除左div和右div所在容器中的浮动。 例如:

它适用于所有浏览器

请记住,left_div和right_div的总宽度不应超过容器