CSS background 属性

179 阅读1分钟
<!DOCTYPE html>
<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>
    <style>
        *{margin:0;padding:0;}
        div{
            width: 0;
            height: 0;
            /* background-color: bisque; */

            /* 盒子模型的顺序是 上右下左 */

            /* border和background 和font一样的 也是一个复合属性 */
            /* 上边框的粗细 */
            border-top-width: 90px;
            /* 想让边框的粗细显示出来必须要规定边框的样式 */
            border-top-style: solid;
            /* 边框的样式默认是黑色 */
            border-top-color: red;

            border-right-width: 90px;
            border-right-style: solid;
            border-right-color: gold;

            border-bottom-width: 90px;
            border-bottom-style: solid;
            border-bottom-color: blue;

            /* transparent透明色 */
            border-left-width: 90px;
            border-left-style: solid;
            border-left-color: transparent;

            


        }
        /* 
        none:无边框
solid:实线边框
dashed:虚线边框
dotted:点状边框
double:双线边框
hidden:与none相同,应用于表解决边框冲突
 */
    </style>
</head>
<body>
    <!-- 写一个div 设置他的上边框是 蓝色 20px 实线 300*300 -->
    <div>
    </div>
</body>
</html>