Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.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
Html 配股_Html_Css_Internet Explorer_Css Float - Fatal编程技术网

Html 配股

Html 配股,html,css,internet-explorer,css-float,Html,Css,Internet Explorer,Css Float,我想让一个div以固定的大小向右浮动,剩下的空间需要保留。 我以流畅的方式做到了这一点: HTML: 这在Firefox和Chrome中非常有效,但在IE8中却完全错了 为了在IE中获得正确的结果,您可以使用它而不是float:right position: absolute; right: 8px; text-align: right; 示例jsBin:(在IE8、Fx上测试) (背景用于测试) 尝试此操作。删除背景色您知道左侧容器需要多宽(以像素为单位),还是可变的

我想让一个div以固定的大小向右浮动,剩下的空间需要保留。 我以流畅的方式做到了这一点:

HTML:


这在Firefox和Chrome中非常有效,但在IE8中却完全错了

为了在IE中获得正确的结果,您可以使用它而不是float:right

    position: absolute;
    right: 8px;
    text-align: right;
示例jsBin:(在IE8、Fx上测试) (背景用于测试)


尝试此操作。删除背景色

您知道左侧容器需要多宽(以像素为单位),还是可变的?尝试在
float:rignt
之后清除
两个
。能否共享您的
部分,文档模式为
IE5怪癖
#leftCntr { 
float: none; /* not needed, just for clarification */
background: #e8f6fe;
/* the next props are meant to keep this block independent from the other floated one */
width: auto;
overflow: hidden; 
}

#rightCntr { float: right; width: 213px;}
    position: absolute;
    right: 8px;
    text-align: right;
.container {
  width: 100%;
  overflow: hidden;
}
#rightCntr {
  float: right;
  width: 213px;
  background: gray;
}
#leftCntr {
   margin-right: 213px; 
   background: yellow;
}
#leftCntr { 
    float: left; 

    /* not needed, just for clarification */ 
    background: #e8f6fe; 

    /* the next props are meant to keep this block independent 
     *  from the other floated one    
     */ 
    width: 100px; 
    overflow: hidden; 
    height: 100px; 
} 

#rightCntr { 
    float: right; 
    width: 213px; 
    border: 1px solid red; 
    background: red; 
    height: 100px; 
    width: 100px; 
    white-space: nowrap;
}