Html 配股
我想让一个div以固定的大小向右浮动,剩下的空间需要保留。 我以流畅的方式做到了这一点: 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上测试) (背景用于测试) 尝试此操作。删除背景色您知道左侧容器需要多宽(以像素为单位),还是可变的
这在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;
}