【发布时间】:2012-11-15 12:08:29
【问题描述】:
我想用 HTML+CSS 制作三列,第一个 15%,第二个 70%,第三个 15%。问题是,使用我的代码,当我调整窗口大小时,第三列正在折叠。我已经为我的网站编写了这样的 CSS:
.maincont {
margin-left: 0px;
margin-right: 0px;
width: 100%;
}
.lcol,
.rcol,
.content {
display: inline;
float: left;
position: relative;
margin-left: 10px;
margin-right: 10px;
}
.lcol {
width: 15%;
background-color: red;
}
.rcol {
width: 15%;
background-color: green;
}
.content {
width: 70%;
background-color: blue;
}
HTML 代码:
<body>
<div class="maincont">
<div class="lcol">
</div>
<div class="content">
</div>
<div class="rcol">
</div>
</div>
</body>
我做错了什么?提前致谢。
【问题讨论】:
标签: html css percentage multiple-columns