11种常用css样式之border学习

2020-02-21 16:00:50来源:博客园 阅读 ()

新老客户大回馈,云服务器低至5折

11种常用css样式之border学习

边框border通常简写为"border:1px solid red;"但其实一个完整的border边框其实是由1.border-width/*边框宽度*/,2.border-style/*边框样式*/,3.border-color/*边框色彩*/三大属性构成构成;

border边框方位分为border-top/*边框上方*/border-bottom/*边框底部*/border-left/*边框左边*/border-right/*边框右边*/;

边框属性样式整理:border-style:none;/*无边框*/border-style:hidden;/*隐藏边框*/border-style:dotted;/*点状虚线*/border-style:dashed;/*块状虚线*/border-style:solid;/*实线*/border-style:double;/*双线*/(至于border-style:groove;border-style:ridge;border-style:inset;border-style:outset;效果用到较少,通常solid,dashed,none);

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 6     <title>11种常用css样式之border学习</title>
 7     <style type="text/css">
 8     /*边框简写*/
 9     .box,.box2{
10         padding: 10px;
11         border-width: 5px;
12     }
13     .box{
14         /* border: 5px inset red; */
15         border-style: inset;
16         border-color: red;
17     }
18     /*边框样式*/
19     .box1{
20         border-style: none;/*无边框*/
21         border-style:hidden;/*隐藏边框*/
22         border-style: dotted;/*点状虚线*/
23         border-style: dashed;/*块状虚线*/
24         border-style: solid;/*实线*/
25         border-style: double;/*双线*/
26         border-style:groove;
27         border-style:ridge;
28         border-style:inset;
29         border-style:outset;
30         border-width: 5px;
31         border-color: #f90;
32     }
33     /*边框方位*/
34     .box2{
35         margin: 10px;
36         border-left: 10px groove cadetblue;
37         border-right: 10px ridge magenta;
38         border-top: 10px inset yellow;
39         border-bottom: 10px outset khaki;
40     }
41     </style>
42 </head>
43 <body>
44     <div class="box">
45         <div class="box1">
46             兄弟,好久不见了,挺念叨你的,不知道现在在哪发财,去跟你混了Brother
47         </div>
48         <div class="box2">
49             it's been a long time since I missed you. I don't know where I'm getting rich now.
50         </div>
51     </div>
52 </body>
53 </html>

原文链接:https://www.cnblogs.com/dhnblog/p/12343315.html
如有疑问请与原作者联系

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:常见CSS3选择器和文本字体样式汇总

下一篇:学习了解CSS3发展方向和CSS样式与优先级