位置:首頁 > 軟件操作教程 > 編程開發(fā) > CSS > 問題詳情

CSS 進框?qū)傩院唽慴order

提問人:劉團圓發(fā)布時間:2020-11-18

    border簡寫屬性在一個聲明中設(shè)置所有的邊框?qū)傩?,可以按順序設(shè)置如下屬性:

    ?border-width;

    ?border-style;

    ?border一color0

    如果不設(shè)置其中的某個值,也不會出問題,比如border:solid #ff0000也是允許的。但是這樣并不會顯示邊框,因為少了寬度。寬度為0的情況下,邊框是不會顯現(xiàn)出來的。

    下面使用兩種方法實現(xiàn)邊框。

    【例題】設(shè)置邊框?qū)傩?/p>

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Document</title>

<style>

.border1{

width: 200px;

height: 200px;

border-width: 20px 10px 15px 5px;

border-style:solid dashed dotted;

border-color:red #00ff00 rgb(0,0,255);

}

.border2{

width: 200px;

height: 200px;

border:solid green 20px;

}

</style>

</head>

<body>

<div></div>

<div></div>

</body>

</html>

image.png

繼續(xù)查找其他問題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部