CSS盒子模型
2015-07-26 17:12
561 查看
CSS 框模型 (Box Model) 规定了元素框处理元素内容、内边距、边框 和 外边距 的方式。
HTML代码如下:
http://localhost:63342/page/Pagemodel.html
点击链接即可查看
HTML代码如下:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>盒子模型的应用</title> <link href="mycss.css" type="text/css" rel="stylesheet"> </head> <body> <div class = "top"> <div class = "top_center"> </div> </div> <div class="body"> <div class = "body_image"></div> <div class = "body_title"></div> <div class = "body_content"></div> </div> </body> </html>CSS代码如下:
*{ margin: 0px; padding: 0px; } .top{ width: 100%; height: 50px; background-color: black; } .top_center{ width: 75%; height: 45px; margin-top: 0px; margin-right: auto; margin-left: auto; margin-bottom: 0px; background-color: darkgray; } .body{ margin: 20px auto; width: 75%; height: 1000px; background-color: aqua; } .body_image{ margin: 10px auto; width: 75%; height: 400px; background-color: blue; } .body_title{ margin:10px auto; width: 75%; height: 200px; background-color: cadetblue; } .body_content{ margin: 10px auto; width: 75%; height: 350px; background-color: darkcyan; }效果如下:
http://localhost:63342/page/Pagemodel.html
点击链接即可查看
相关文章推荐
- 怎么改变Extjs控件的样式(字体颜色、背景颜色等)
- CSS3:nth-child(n)与nth-child(2n+1)中n的区别。
- 纯CSS实现三列布局(两边固定,中间自适应)
- CSS3中li元素自动横向排列、多栏div自动横向排列的简单方法
- 关于css布局
- 详解用CSS3制作圆形滚动进度条动画效果
- CSS易混淆知识点总结与分享-定位与布局
- 揭开CSS3媒体查询迷雾(min-width和max-width)
- 通过样式调整input 中password text默认长度
- CSS3 calc()的使用
- ZOOM:1的原理和作用
- 纯CSS实现三列布局(两边固定,中间自适应)
- 在action跳转的jsp页面中引入静态js、css文件
- 解读CSS布局之-水平垂直居中
- 利用display属性写出表格的布局样式
- CSS 中 px,em和rem 的区别 学习笔记
- 常用的ie6,ie7,ie8 css bug兼容性解决
- css3
- html网页的兼容性和css优先级
- 18种CSS3loading效果完整版,兼容各大主流浏览器,提供在线小工具使用