如何在css中设置版心宽?

html-css022

如何在css中设置版心宽?,第1张

布局流程为了提高网页制作的效率,布局时通常需要遵守一定的布局流程,具体如下:1、确定页面的版心(可视区)。2、分析页面中的行模块,以及每个行模块中的列模块。3、制作HTML结构 。4、CSS初始化,然后开始运用盒子模型的原理,通过DIV+CSS布局来控制网页的各个模块。 一列固定宽度且居中案例<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Document</title><style>.box {width: 900pxbackground-color: #eeeborder: 1px dashed #cccmargin: 0 auto}.top {height: 80px}.banner {height: 120px/*margin: 0 auto*/margin: 5px auto}.main {height: 500px}.footer {height: 100px/*margin: 0 automargin-top:5px*/ margin: 5px auto 0}</style></head><body><div class="top box">top</div><div class="banner box">banner</div><div class="main box"></div><div class="footer box"></div></body></html>

css中一般是用font-size来设置字体大小。

示例:

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>css字号设置</title>

<style>

div{font-size:16px}

p{font-size:18px}

h2{font-size:20px}

</style>

</head>

<body>

<div>16号字体<div>

<p>18号字体</p>

<h2>20号字体(h2自带字体属性)</h2>

</body>

</html>