边框属性

115 阅读1分钟
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 边框在实际页面中是占位置的,加边框需要减去对应的div的宽度 -->
    <style>
        .box{
            width: 300px;
            height: 300px;
            /* 边框属性 */
            border:5px dotted #000;
                /* 第一个值是边框的宽度 */
                /* 第二个值是边框的线型:实线solid;虚线dashed;点划线dotted */
                /* 第三个值是边框的颜色 */

            /* 上边框 */
            border-right: 5px dotted #000;
            /* 下边框 */
            border-bottom: 5px dotted #000;
            /* 左边框 */
            border-left: 5px dotted #000;
            /* 右边框 */ 
            border-right: 5px dotted #000;
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>