1. 程式人生 > >Python學習記錄W14-18:css選擇器

Python學習記錄W14-18:css選擇器

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
         /*--- id選擇器--- */
        #i1,#i2,#i3{
            background-color: black;
            color: white;
        }

         /*--- class選擇器--- */
        .c1,.c2,.c3{
            background-color: black;
            color: white;
        }

         /*--- 標籤選擇器--- */
        div{
            background-color: black;
            color: white;
        }

         /*--- 層級選擇器--- */
        span div{
            background-color: black;
            color: white;
        }
        .c1 div{
            background-color: black;
            color: white;
        }

         /*--- 屬性選擇器--- */
        input[type="text"]{width:100px; height:200px;}
        .t1[type="password"]{width:100px; height:200px;}
    </style>
</head>
<body>
    <div class="c1">1</div>
    <span  class="c2">222222
        <div>123</div>
        222222</span>
    <div  class="c3">3</div>
    <input type="text">
    <input class="t1" type="password">
</body>
</html>