<!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>
CSS盒子模型 边框的应用
最新推荐文章于 2024-04-28 16:04:57 发布