CSS——边框设置

Posted zhai1997

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CSS——边框设置相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <title>CSS</title>
        <style type="text/css">
        .class1
        border-style: dotted;    
        height: 20px;
        
        .class2
        border-style:dashed dotted;
        height: 20px;    
        
        .class3
        border-style: dashed dotted double;     
        height: 20px;
        
        .class4
        border-style: dashed  dotted double groove; 
        height: 20px;
        
        </style>
    </head>

    <body bgcolor="aquamarine">
    <p class=class1></p>
    <p class=class2></p>
    <p class=class3></p>
    <p class=class4></p>
    </body>

</html>

对边框的设置有综合属性:border-style,亦可运用其他四个属性分别对边框的边进行设置。

技术图片

边框宽度设置:

<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <title>CSS</title>
        <style type="text/css">
        .class1
        border-style: dotted;    
        border-width: 2px;
        height: 20px;
        
        .class2
        border-style:dashed dotted;
        border-width: 2px 4px;
        height: 20px;    
        
        .class3
        border-style: dashed dotted double; 
        border-width: 2px 4px 6px;    
        height: 20px;
        
        .class4
        border-style: dashed  dotted double groove; 
        border-width: 2px 4px 6px 8px;
        height: 20px;
        
        </style>
    </head>

    <body bgcolor="aquamarine">
    <p class=class1></p>
    <p class=class2></p>
    <p class=class3></p>
    <p class=class4></p>
    </body>

</html>

技术图片

 

以上是关于CSS——边框设置的主要内容,如果未能解决你的问题,请参考以下文章

CSS如何怎么设置div边框颜色宽度和高度

CSS如何怎么设置div边框颜色宽度和高度?

androidbutton边框,htmlbutton按钮边框椭圆,怎么加css

如何用css使边框颜色渐变

第17章 CSS边框与背景(上)

div css圆角边框怎么设置