<!DOCTYPE HTML>
<html>
<head>
<title>边框</title>
<meta charset="utf-8">
<style>
*{margin:0;padding: 0}
/*
当长度为0px时,可以把px省略。
*/
.box-top{width: 100px;height: 100px; /*border: 50px solid red*/ border-top: 50px solid red;border-bottom: 50px solid blue;border-left: 50px solid yellow;border-right: 50px solid green;}
/*
border线条取值可以是
solid实线
dotted点线 当线宽越大时,dotted会出现兼容性问题,比如那个点在不同浏览器中的实现方式不一样,有些是正方形的点而有些确实圆点。
dashed 虚线
*/
</style>
</head>
<body>
<div class="box-top"></div>
</body>
</html>
CSS3-border基本使用
最新推荐文章于 2024-04-29 00:43:46 发布