运行效果
HTML部分:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
table{
border-collapse: collapse;
}
td{
width: 100px;
height: 50px;
text-align: center;
border:1px solid #000;
}
.add{
margin: 0 0 50px 0;
}
.change{
position: fixed;
top:0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
display: flex;
justify-content: center;
align-items: center;
display:none;
}
.change>div{
width: 300px;
height: 200px;
background: #fff;
padding: 20px 0 0 20px;
}
</style>
</head>
<body>
<!-- 新增 -->
<div class="add">
姓名: <input type="text" name="name"><br>
性别: 男<input type="radio" name="sex" value="男">
女<input type="radio" name="sex" value="女">
保密<input type="radio" name="sex" value="保密"><br>
年龄: <input type="number" name="age" min="0" max="250"><br>
城市: <select name="city">
<option value="0">北京</option>
<option value="1">上海</option>
<option value="2">广州</option>
<option value="3">重庆</option>
<option value="4">天津</option>
</select><br>
<button>新增</button>
</div>
<!-- 修改 -->
<div class="change">
<div>
姓名: <input type="text" name="name"><br>
性别: 男<input type="radio" name="sex" value="男">
女<input type="radio" name="sex" value="女">
保密<input type="radio" name