效果图在最下面哦
<!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>
</head>
<style>
.box {
width: 400px;
height: 400px;
border: 5px solid pink;
}
#messageTable {
position: absolute;
top: 0;
left: 40%;
width: 500px;
margin: 0 auto;
}
/* tr th{
width: 300px;
} */
p {
font-size: 30px;
transform: translateX(20px);
}
.inp {
width: 250px;
height: 40px;
outline: none;
border-radius: 5px;
font-size: 30px;
}
#btn {
background-color: lightseagreen;
border-radius: 5px;
width: 100px;
height: 30px;
transform: translateX(150px);
}
td {
text-align: center;
}
#box2{
position: absolute;
left: 75%;
top: 0;
}
</style>
<body>
<form class="box" action="">
<p>姓名:<input type="text" class="inp"></p>
<p>年龄:<input type="text" class="inp"></p>
<p>性别:<input type="text" class="inp"></p>
<p>学号:<input type="text" class="inp"></p>
<input type="button" id="btn" value="提交"></input>
</form>
<table id="messageTable" border="" cellspacing="" cellpadding="">
<tr>
<th>序号</th>
<th>姓名</th>
<th>年龄</th>
<th>性别</th>
<th>学号</th>
<th>操作</th>
</tr>
</table>
<div id="box2">
<input id="input2&#