我有我的网站下的开发http://hrcprojectconsulting.com/,这看起来很好,当在屏幕上看到我的分辨率和大小,否则,水平滚动弹出,并使浏览恼人。
所以我不知道我到底要做什么。有流畅的布局,但它们充满了整个屏幕,这将是一种太多的一切都分散了出来。但是,如果我使用一些固定的css,那么问题是,根据屏幕大小和分辨率,可能会出现水平滚动条,这是不能发生的。
是的,是的,我已经完成了所有的阅读,实际上我正在遵循一个非常好的教程
http://www.netmagazine.com/tutorials/create-fluid-layouts-html5-and-css3#null
我知道作者是做什么的,它看起来很简单,所以我用我的来做,在最简单的一步,它让我失败了,(可能是因为我有另一个布局)
我的HTML现在(我今天尝试添加一个页脚,但页脚既不停留在底部,也不被内容向下推,而是溢出,但这是另一回事)
下面是html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" href= "<?php echo base_url() ?>css/main_style.css" />
<script type ="text/javascript" src="<?php echo base_url()?>js/1.8.js"></script>
<title>Website</title>
</head>
<body>
<div id="container">
<div id="header"></div>
<div id="content">
<div id="left_content"></div>
<div id="middle_content"></div>
<div id="right_content"></div>
</div>
</div>
</body>
</html>这是CSS
#container {
width:1040px;
margin:0 auto;
}
#header {
height:50px;
margin-bottom:20px;
}
#left_content {
float: left;
width:180px;
min-height: 600px;
margin-right:20px;
}
#middle_content {
font-family: 'trebuchet ms',geneva,arial,tahoma,sans-serif;
font-size:8px;
float: left;
width:640px;
min-height: 600px;
margin-right:0px;
}
#right_content {
float: right;
width:180px;
margin-right:20px;
min-height: 600px;
}
#footer {
float: left;
background: green;
margin-top: 20px;
margin-right: 10px;
margin-left: 10px;
clear: both;
width: 1020px;
height:200px;
} 因此,我试图按照作者的想法,开始修改最外层的包装器容器,将1040px;更改为96%。
当我这样做的时候,你看到的标题的蓝色条缩小到大约400px并漂移到左边,加上你可以看到所有标签和框的webform,只是零散地漂浮在botton上,完全不喜欢它自己,所以一团糟。
怎么会这样?为什么我不能开始做作者正在做的设计呢?他从96%的变化开始。
发布于 2012-11-18 02:40:11
这是因为将1040px更改为96%会给内部的浮动元素提供更多的“空间”。
如果96% > 1040px,则浮点数将上升到顶部,并且彼此相邻。
尝试将所有的子元素也设为基于%的。
https://stackoverflow.com/questions/13432799
复制相似问题