Joh*_*ker 5 html css formatting
我有3个漂浮的左侧物体,左侧的物体将一直变大.权利将始终固定大小.中心我想填补两个外部div之间的空间.现在,这不起作用.如果我将中心div的宽度设置为100%,那就太大了.
不知道应该如何处理.
编辑:代码示例
<div style="width:1000px">
<div style="float:left;">1</div>
<div style="float:left;">Lots of text in here that can be any size....</div>
<div style="float:left; width:100px;">Date/Time</div>
</div>
Run Code Online (Sandbox Code Playgroud)
第一个div的大小是动态的.如果数字是10,它将占用比数字1更多的空间.第二个div也将是动态的,我想要占用第一个和第三个div不占用的空间.
超文本标记语言
<div style="width:1000px">
<div id="left">1</div>
<div id="right">Date/Time</div>
<div id="center">Lots of text in here that can be any size....</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
#left {
float: left;
width: 20%;
}
#center {
margin-left: 20%;
margin-right: 100px;
}
#right {
float: right;
width: 100px;
}
Run Code Online (Sandbox Code Playgroud)
参见小提琴。