border-style之dotted顯示一個圓
阿新 • • 發佈:2018-11-14
dotted邊框:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>製作我的第一個網頁</title>
<style type="text/css">
.dotted{
width:150px;
height :150px;
border:149px dotted red;
}
</style>
</head>
<body>
<div class="dotted"></div>
</body>
</html>
效果:
改進後:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>製作我的第一個網頁</title>
<style type="text/css">
.box{
width:150px;
height:150px;
overflow:hidden;
}
.dotted{
width:100%;
height :100%;
border:149px dotted red;
}
</style>
</head>
<body>
<h1>Hello World</h1>
<div class="box">
<div class="dotted"></div>
</div>
</body>
</html>
效果如圖: