1. 程式人生 > 其它 >CSS盒子模型 邊框的應用

CSS盒子模型 邊框的應用

技術標籤:JavaCSScss邊框

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>邊框</title>
    <style>
    #box{
        border: 1px solid red;
        width: 300px;
    }
    
    form{
        background-color: blue;
    }
h2{ background-color: red; font-size: 16px; line-height: 30px; margin: 0; } /*選中第一個div 並新增邊框*/ div:nth-of-type(1) input{ border: 3px solid black; } div:nth-of-type(2) input{ border: 3px dashed yellow; }
</style> </
head
>
<body> <div id="box"> <h2>會員登陸</h2> <form action="#" method="get"> <div> 使用者名稱: <input type="text"> </div> <div> 密碼: <
input
type="text">
</div> </form> </div> </body> </html>

在這裡插入圖片描述