css中的边框样式(border border-radius border-shadow)

Original 2019-03-24 12:24:18 596
abstract: <!--  CSS盒模型——边框(border)  --> <!DOCTYPE html><head> <meta charset="UTF-8"> <title>学习css第三节课 —— CSS边框</title> <link rel="short

 <!-- 

CSS盒模型——边框(border)

  -->

 <!DOCTYPE html>

<head>

<meta charset="UTF-8">

<title>学习css第三节课 —— CSS边框</title>

<link rel="shortcut icon" type="image/x-icon" href="../Public/images/2.1.png">

<!-- 外部样式 -->

<link rel="stylesheet" type="text/css" href="../Public/css/2.1.css">

<!-- 内部样式 -->

<style type="text/css">

/* 

复合写法 border: 1px solid #ccc;   线的大小  线的类型(solid 实线  double 双线  dashed 线状虚线  dotted 点状虚线)  线的颜色

设置圆角 border-radius: 10px; 正方形如若设置直径的一半 则变成圆

*/

.box{width: 100px;height: 100px; border: 1px solid #ccc; border-radius: 50px;}

/* 

单边边框 

border-top:1px solid red; 

border-bottom:1px solid red;

border-left:1px solid red;

border-right:1px solid red;

*/

.main{width: 100px;height: 100px;border-top:1px solid red;background: #ccc;margin-top: 10px;}

/* 清除边框 */

button{border: none;}

/* box-shadow:10px 5px 3px #ccc; x轴方向的阴影位置  y轴方向的阴影位置  阴影宽度(数值越大会形成光晕效果)  阴影颜色  inset(可选参数 效果:阴影向内)*/ 

.shadow{width: 300px;height: 40px;box-shadow:0px 0px 10px #ccc inset;border:1px solid #ccc;}

</style>

</head>

<body>

<div class="box"></div>

<div class="main"></div>

<button>登录</button>

<div class="shadow"></div>

</body>

</html>



Correcting teacher:天蓬老师Correction time:2019-03-25 09:23:33
Teacher's summary:在盒模型中, 只有边框的设置是最复杂的, 因为内外边距都是透明的, 只有宽度, 没有样式, 而边框除了宽度外, 是有样式的

Release Notes

Popular Entries