只需要帮助,因为我一直在尝试对此进行整理,现在已经有很多年了。我需要的是:2列布局(左列固定宽度,右液体+清除:两者)
我有一个2列布局,其中左列的固定宽度为220px,右列为流体宽度。
代码是:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Fluid</title>
<style type="text/css" media="screen">
html, body { background: #ccc; }
.wrap { margin: 20px; padding: 20px; background: #fff; }
.main { margin-left: 220px; width: auto }
.sidebar { width: 200px; float: left; }
.main,
.sidebar { background: #eee; min-height: 100px; }
</style>
</head>
<body>
<div class="wrap">
<div class="sidebar">This is the static sidebar</div>
<div class="main">This is the main, and fluid div</div>
</div>
</body>
</html>
有一点问题都没有。当我使用css语法清除:在右列中均为,将所有内容移到左列后面。这是一个正确的行为,没有任何反对。
但我relly需要用明确的:无论是在路上,它仅仅停留在右列的情况下(不得到由左边的列在所有受影响的,不动的下面)
有没有简单的解决方法来保留页面设计的基本浮点概念?
更新:请参阅此链接以了解我在说什么,因为从我的描述可能有点混淆。 链接:http://jsfiddle.net/k4L5K/1/
演示:http://jsfiddle.net/a4xyV/ –