Css yui-液体总管,固定内容物
如何使用yui创建液体页眉(100%)和固定内容(950px)和页脚 大概是这样的:Css yui-液体总管,固定内容物,css,yui,Css,Yui,如何使用yui创建液体页眉(100%)和固定内容(950px)和页脚 大概是这样的: ---------------------------------- | header (liquid) | ---------------------------------- | left | right | ------------------- | footer | ------------
----------------------------------
| header (liquid) |
----------------------------------
| left | right |
-------------------
| footer |
-------------------
非常感谢您的任何意见。这里,我为您附上了一个非常基本的结构
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Stackoverflow</title>
<style type="text/css">
body{
margin:0;
}
#container{
width:100%;
}
#header{
width:100%;
background:olive;
}
#content{
width:950px;
margin:0 auto;
overflow:hidden;
}
#left{
width:500px;
float:left;
background:blueviolet;
}
#right{
width:430px;
float:right;
background:green;
}
#footer{
width:100%;
overflow:hidden;
background:red;
}
</style>
</head>
<body>
<div id="container">
<div id="header">I'm the header with a width of 100%</div>
<div id="content">
<div id="left">
<h1>I'm the left floated content</h1>
<p>lorem ipsum</p>
</div>
<div id="right">
<h2>I'm the right floated content</h2>
<p>lorem ipsum</p>
</div>
<div id="footer">
<h3>I'm the footer</h3>
</div>
</div>
</div>
</body>
</html>
栈溢出
身体{
保证金:0;
}
#容器{
宽度:100%;
}
#标题{
宽度:100%;
背景:橄榄;
}
#内容{
宽度:950px;
保证金:0自动;
溢出:隐藏;
}
#左{
宽度:500px;
浮动:左;
背景:蓝紫罗兰;
}
#对{
宽度:430px;
浮动:对;
背景:绿色;
}
#页脚{
宽度:100%;
溢出:隐藏;
背景:红色;
}
我是宽度为100%的标题
我是左边浮动的内容
同侧眼睑
我是正确的浮动内容
同侧眼睑
我是页脚
我希望这有帮助 最好的方法是使用CSS网格,在#doc2 div之外创建一个div,作为标题div。只需从#doc2 div内部删除div#hd,就不会有标题
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YUI Base Page</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
</head>
<body>
<div id="doc3" class="yui-t7"><div id="hd" role="banner">Header</div></div>
<div id="doc2" class="yui-t7">
<div id="bd" role="main">
<div class="yui-g">
<!-- YOUR DATA GOES HERE -->
</div>
</div>
<div id="ft" role="contentinfo"><p>Footer</p></div>
</div>
</body>
</html>
YUI基页
标题
页脚
我还用另一个包裹。谢谢你,顺便说一句。