手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >自适应宽度的div+css示例
自适应宽度的div+css示例
摘要:以下是代码:NiceandFreeCSSTemplate10centerThisBOXistcenteredandadjustsitself...

以下是代码:
<html>
<head>
<title>Nice and Free CSS Template 10</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;
margin: 20px 140px  20px 140px;
text-align: center;
}
#content {
width: 100%;
padding: 0px;
text-align: left;
background-color: #fff;
overflow: auto;
}
p, h1, pre {
margin: 0px;
padding: 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;
}
--></style></head>
<body>
<div id="content">
<p><b>center</b><br /><br />
This BOX ist centered and adjusts itself to the browser window.<br />
The height ajusts itself to the content.<br />
<a href="/">more nice and free css templates</a>
</p>
<pre>
body {
background-color: #e1ddd9;
font-size: 12px;
font-family: Verdana, Arial, Helvetica, SunSans-Regular, Sans-Serif;
color:#564b47;
margin: 20px 140px  20px 140px;
text-align: center;
}
#content {
width: 100%;
padding: 0px;
text-align: left;
background-color: #fff;
overflow: auto;
}
</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+css示例】相关文章:

让网站变灰的css代码

愚人节巧用CSS开个极客式玩笑以chrome为例

实现CSS3中的border-radius(边框圆角)示例代码

css控制div中元素居中的示例

min-width最小宽度的作用介绍

CSS导航布局中当前页面的具体实现demo示例

css 文本两端对齐应用实例

css按钮自适应实现原理及代码

相邻div实现一个跟着另一个自适应高度示例代码

大图片根据分辨率自适应宽度仍居中显示

精品推荐
分类导航