马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
一、版心
版心:是指网页主题内容所在的地区。一样平常在欣赏器窗口程度居中位置,常见的宽度值为960px、980px、1000px、1200px等。
二、结构流程
为了进步网页制作的服从,结构时必要服从肯定的结构流程,具体如下:
- 确定页面版心
- 分析页面中的行模块,以及每个行模块中的列模块
- 制作HTML结构
- CSS初始化,然后开始运用盒子模子的原理,通过CID+CSS结构来控制网页的各个模块
三、一列固定宽度且居中
- <html>
- <head>
- <style>
- * {
- padding: 0;
- margin: 0;
- }
- .top,
- .banner,
- .main,
- .footer {
- width: 960px;
- margin: 10px auto;
- text-align: center;
- }
- .top {
- height: 100px;
- background-color: pink;
- }
- .banner {
- height: 120px;
- background-color: skyblue;
- }
- .main {
- height: 500px;
- background-color: red;
- }
- .footer {
- height: 150px;
- background-color: #ccc;
- }
- </style>
- </head>
- <body>
- <div class="top">top</div>
- <div class="banner">banner</div>
- <div class="main">main</div>
- <div class="footer">footer</div>
- </body>
- </html>
复制代码 四、两列左窄右宽
- <html>
- <head>
- <style>
- * {
- padding: 0;
- margin: 0;
- }
- .top,
- .banner,
- .main,
- .footer {
- width: 960px;
- margin: 10px auto;
- text-align: center;
- }
- .top {
- height: 100px;
- background-color: pink;
- }
- .banner {
- height: 120px;
- background-color: skyblue;
- }
- .main {
- height: 500px;
- background-color: red;
- }
- .footer {
- height: 150px;
- background-color: #ccc;
- }
- .main .left {
- width: 360px;
- height: 500px;
- float: left;
- background-color: white;
- }
- .main .right {
- width: 590px;
- height: 500px;
- margin-left: 10px;
- float: left;
- background-color: white;
- }
- </style>
- </head>
- <body>
- <div class="top">top</div>
- <div class="banner">banner</div>
- <div class="main">
- <div class="left">left</div>
- <div class="right">right</div>
- </div>
- <div class="footer">footer</div>
- </body>
- </html>
复制代码 五、通栏均匀分布型
- <html>
- <head>
- <style>
- * {
- padding: 0;
- margin: 0;
- }
- ul {
- list-style: none;
- }
- .top,
- .banner,
- .main,
- .footer {
- width: 960px;
- margin: 10px auto;
- text-align: center;
- }
- .top {
- height: 100px;
- background-color: pink;
- }
- .banner {
- height: 120px;
- background-color: skyblue;
- }
- .main {
- height: 500px;
- background-color: red;
- }
- .footer {
- height: 150px;
- background-color: #ccc;
- }
- .main ul li:nth-child(odd) {
- width: 240px;
- height: 240px;
- background-color: deeppink;
- float: left;
- }
- .main ul li:nth-child(even) {
- width: 240px;
- height: 240px;
- background-color: hotpink;
- float: left;
- }
- </style>
- </head>
- <body>
- <div class="top">top</div>
- <div class="banner">banner</div>
- <div class="main">
- <ul>
- <li>1</li>
- <li>2</li>
- <li>3</li>
- <li>4</li>
- </ul>
- </div>
- <div class="footer">footer</div>
- </body>
- </html>
复制代码 |