css学习之边框样式、外边距合并
2016-12-06 09:56
435 查看
边框的样式:
border-style:定义了10个不同的非继承样式,包括none
边框的单边框样式:
border-top-style
border-left-style
border-right-style
border-bottom-style
边框的宽度:
border-width
单边框:
border-top-width
border-left-width
border-right-width
border-bottom-width
边框颜色、边框的单边框颜色:
border-color
border-top-color
border-left-color
border-right-color
border-bottom-color
css3边框:
border-radius:圆角边框
box-shadow:边框阴影
border-image:边框图片
外边距合并:
外边距合并就是一个叠加的概念。
效果图
html:
div外边距合并的话,如果一个div的外边距是100px;一个外边距是50px;那么最终按照100px来进行合并。
border-style:定义了10个不同的非继承样式,包括none
边框的单边框样式:
border-top-style
border-left-style
border-right-style
border-bottom-style
边框的宽度:
border-width
单边框:
border-top-width
border-left-width
border-right-width
border-bottom-width
边框颜色、边框的单边框颜色:
border-color
border-top-color
border-left-color
border-right-color
border-bottom-color
css3边框:
border-radius:圆角边框
box-shadow:边框阴影
border-image:边框图片
外边距合并:
外边距合并就是一个叠加的概念。
效果图
html:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body> <div class="container"> <div class="bd"> <div class="pd"> <div class="content">Hello</div> </div> </div> </div> <div class="container1"> <div class="bd1"> <div class="pd1"> <div class="content1">Hello</div> </div> </div> </div> </body> </html>css:
body{ margin:0; } .container{ margin: 50px; } .bd{ border-style: groove; } .pd{ padding: 10px; } .content{ background-color: blue; } .container1{ margin: 100px; } .bd1{ border-style: groove; } .pd1{ padding: 10px; } .content1{ background-color: blue; }
div外边距合并的话,如果一个div的外边距是100px;一个外边距是50px;那么最终按照100px来进行合并。
相关文章推荐
- CSS 各种定位(position)方式的区别
- [deviceone开发]-多种样式下拉菜单demo
- CSS学习、Day01
- css3实现的3中loading动画效果
- 自定义 ProgressBar 样式
- 使用sass进行模块化的7-1模式
- CSS 布局模块
- js访问CSS的2种方法(点法和中括号法的区别),内含获取属性的兼容写法
- 淘宝样式初始化代码
- css3选择器--基本选择器,层次选择器,属性选择器
- CSS内边距和外边距
- CSS选择器优先级与效率优化
- CSS选择器性能分析
- css学习之属性选择器
- css学习之二轮廓
- CSS边框
- css学习之二表格
- CSS transitions深入理解
- CSS选择符有哪些?哪些属性可以继承?优先级算法如何计算?内联和important哪个优先级高?
- 第二章 CSS3新增的选器之 选择器 last-child last-of-type区别