摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>学习</title> <link rel="stylesheet" type="text/css"
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>学习</title> <link rel="stylesheet" type="text/css" href="css/index.css"> <style type="text/css"> *{margin: 0px;} .radius{background: #74cd2d;width: 500px;height: 500px;border-radius:250px; margin: 50px auto 0px;} .box{width: 50px;height: 350px;box-shadow: 0px 30px 60px #ccc inset; margin: -2px auto 0px;} .yuan1{background: #b97c24; width: 400px;height: 400px;border-radius: 200px;margin: -800px auto;} .yuan2{background: #e6db5e; width: 300px;height: 300px;border-radius: 300px;margin: 450px auto;} </style> </head> <body> <div class="radius"></div> <div class="box"></div> <div class="yuan1"></div> <div class="yuan2"></div> </body> </html>
感谢老师的悉心教导,请您吃个棒棒糖!
1,学习了border边框的设置。设置上边框border-top;右边框border-right;下边框border-bottom;左边框border-left。
2,border边框类型有四种,设置solid为直线边框,double为双边框,dashed为虚线边框,dotted为点边框。
3,有些元素自带边框,如button,可以使用标签选择器设置button{border: none;}来去除button自带的边框
4,边框弧度调整可用border-radius
4,设置边框阴影box-shadow,第一个px为阴影离元素box向右的偏移距离,第二个px为向下偏移距离,第三个px为阴影的模糊程度。在内部样式里加inset可设置为内阴影。
批改老师:天蓬老师批改时间:2018-11-02 22:37:42
老师总结:边框的圆角样式也很重要,特别是可以任何定义四个方向.
还有,要注意边框与内外边距的区别