css03
来源:互联网 发布:单片机 脉冲交流信号 编辑:程序博客网 时间:2024/06/08 02:50
CSS的盒子模型是由margin、padding、border、content组成。
css的内边距padding,可以设置左内边距、右内边距、上下内边距等。
css的边框border,可以设置边框样式border-style、圆角边框border-radius、设置边框阴影box-shadow、设置边框图片border-image
css的盒子模式的外边距
<div class="bd"> <div class="pd"> <div class="content"> 编辑内容 </div> </div> </div>
.bd{ border-style: dotted;}.pd{ padding: 10px;}.content{ background-color: blue;}
css的外边距合并。如果两个控件的margin都是100px那么,这两个控件之间的距离也是100px;css的外边距合并会取数值较大的一个。
盒子模型的应用
html
<div class="top"> <div class="top_content"></div> </div> <div class="body"> <div class="body_img"></div> <div class="body_no"></div> <div class="body_content"></div> </div> <div class="footing"> <div class="footing_content"></div> <div class="footing_subnav"></div> </div>css
*{ margin: 0px; padding: 0px;}.top{ width: 100%; height: 50px; background-color: black;}.top_content{ width: 75%; height: 50px; margin: 0px auto; background-color: blue;}.body{ margin: 20px auto; width: 75%; height: 1500px; background-color: antiquewhite;}.body_img{ width: 100%; height: 400px; background-color: cadetblue;}.body_content{ width: 100%; height: 1100px; background-color: blueviolet;}.body_no{ width: 100%; height: 30px; background-color: aquamarine;}.footing{ width: 75%; height: 400px; background-color: chartreuse; margin: 0px auto;}.footing_content{ width: 100%; height: 350px; background-color: brown;}.footing_subnav{ width: 100%; height: 70px; background-color: darkgreen;}
0 0
- css03
- CSS03——样式继承与层叠
- mac 下启动Android Studio 时出现 Android Studio was unable to find a valid Jvm
- Yale开放课程博弈论23
- 实现追加函数char *my_strcat(char *dest,char *src)
- java语言GUI编程之鼠标适配器总结
- java增强for循环
- css03
- VIM使用笔记 删除、复制引号,括号中的内容
- SAR 命令详解
- Java_语法基础_goto与const
- swift UI专项训练41 用纯代码的方式实现stepper的值传递
- 进程间通信机制
- 使用collapsed gibbs sampling对LDA中参数进行估计的推导过程
- 中国省份与城市 app常用省份和城市(2015-4-16日 更新)
- 3.21总结