如何采用div+css设计横线或者竖线

如题所述

第1个回答  推荐于2016-07-07
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<style>
.cross{
width:500px;
height:0;
border-top:1px solid blue;
}
.vertical{
width:0;
height:400px;
border-left:1px solid red;
}
</style>
<body>
<div class="cross"></div>
<div class="vertical"></div>
</body>
</html>

如果需要线条的粗细,可以改动border的粗细,比如

.vertical{
width:0;
height:400px;
border-left:5px solid red;
}本回答被提问者采纳