手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >自动调整高度的div层
自动调整高度的div层
摘要:以下是代码:NiceandFreeCSSTemplate09centeraFIXEDBOXThisBOXhasafixedwidth.Iti...

以下是代码:
<html>
<head>
<title>Nice and Free CSS Template 09</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="screen"><!--
body {
background-color: #e1ddd9;
font-size: 12px;
font-family: Verdana, Arial, Helvetica, SunSans-Regular, Sans-Serif;
color:#564b47;
padding:20px;
margin:0px;
text-align: center;
}
#content {
text-align: left;
vertical-align: middle;
margin: 0px auto;
padding: 0px;
width: 550px;
background-color: #ffffff;
border: 1px dashed #564b47;
}
p, h1, pre {
margin: 0px;
padding: 5px 10px;
}
h1 {
font-size: 11px;
text-transform:uppercase;
text-align: right;
color: #564b47;
background-color: #90897a;
}
a {
color: #ff66cc;
font-size: 11px;
background-color:transparent;
text-decoration: none;
}
pre {
color: #564b47;
font-size: 11px;
background-color:transparent;
font-family: Courier, Monaco, Monospace;
}
--></style></head>
<body>
<div id="content">
<p><b>center a FIXED BOX</b><br /><br />
This BOX has a fixed width.<br />
It is centered and adjusts to the browser window.<br />
The height adjusts to the content.<br />
<a href="/">more nice and free css templates</a><br />
</p>
<pre>
body {
background-color: #e1ddd9;
font-size: 12px;
color:#564b47;
padding:20px;
margin:0px;
text-align: center;
}
#inhalt {
text-align: left;
vertical-align: middle;
margin: 0px auto;
padding: 0px;
width: 550px;
background-color: #ffffff;
border: 1px dashed #564b47;
}
</pre>
<p>
<img src="xhtml10.gif" alt="" width="80" height="15" border="0"/> <img src="css.gif" alt="" width="80" height="15" border="0"/>
</p>
</div>
</body>
</html>

【自动调整高度的div层】相关文章:

10条影响CSS渲染速度的写法

CSS基础教程:CSS的color颜色

自动按时段切换网页的CSS风格

CSS如何控制网页(WEB)字体

文字环绕图片的布局效果

常用的10种CSS BUG解决方法与技巧

用CSS自定义滚动条的样式

CSS表单元素垂直居中完美解决方案

IE6定义1px左右高度的容器示例代码

css自动换行的技巧

精品推荐
分类导航