console
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<body>
<div class="main">
<h1>大学生消费调查</h1>
<hr>
<form action="/server/question" method="POST" class="form">
<div class="fieldset">
<fieldset>
<legend><h2>基本信息</h2></legend>
<div class="field">
<span>姓名: </span>
<input type="text" name="name" id="name" required />
</div>
<div class="field">
<span>年龄: </span>
<input type="number" name="age" id="age" required />
</div>
<div class="field">
<span>性别: </span>
<label><input type="radio" name="sex" />男</label>
<label><input type="radio" name="sex" checked />女</label>
</div>
<div class="field">
<span>年级:</span>
<select name="class" id="class">
<option value="">大一</option>
<option value="">大二</option>
<option value="">大三</option>
<option value="">大四</option>
</select>
</div>
<div class="field">
<span>个人简介: </span><br>
<textarea name="intro" id="intro" cols="85" rows="3"></textarea>
</div>
</fieldset>
</div>
<div class="fieldset">
<fieldset>
<legend><h2>消费情况</h2></legend>
<div class="field">
<div class="field">
<span>每月消费总额:</span><br />
<label><input type="radio" name="pay"/>500元以下</label><br />
<label><input type="radio" name="pay"/>500元~1000元</label><br />
<label><input type="radio" name="pay"/>1000元~1500元</label><br />
<label><input type="radio" name="pay"/>1500元以上</label><br />
</div>
<hr>
<div class="field">
<span>生活费来源: </span><br />
<label><input type="checkbox" name="compiler" />父母给予</label><br />
<label><input type="checkbox" name="compiler" />勤工助学</label><br />
<label><input type="checkbox" name="compiler" />奖学金</label><br />
<label><input type="checkbox" name="compiler" />校外兼职</label><br />
<label><input type="checkbox" name="compiler" />补助</label><br />
<label><input type="checkbox" name="compiler" />其他</label><br />
</div>
<hr>
<div class="field">
<span>消费方面: </span><br />
<label><input type="checkbox" name="compiler" />伙食</label><br />
<label><input type="checkbox" name="compiler" />服装、化装品</label><br />
<label><input type="checkbox" name="compiler" />学习</label><br />
<label><input type="checkbox" name="compiler" />交际</label><br />
<label><input type="checkbox" name="compiler" />上网</label><br />
<label><input type="checkbox" name="compiler" />其他</label><br />
</div>
</div>
</fieldset>
</div>
<div class="fieldset">
<fieldset>
<span><legend>上传头像</legend></span>
<div class="field">
<label for="file">选择文件: </label>
<input type="file" name="file" id="file" class="btn btn-info"/>
</div>
</fieldset>
</div>
<div class="field">
<input type="submit" value="提交" class="btn btn-secondary btn-lg btn-block"/>
</div>
</form>
</div>
</body>
*{
font-family: "楷体";
}
.main {
width: 800px;
margin: auto;
margin-top: 10px;
margin-bottom: 30px;
border: solid 2px rgba(0, 0, 0, 0.3);
padding: 20px;
background-color: rgba(245, 245, 245, 0.4);
border-radius: 12px;
}
h1 {
text-align: center;
}
span {
font-size: 14px;
font-weight: 600;
}
.field {
padding: 10px;
margin: 5px;
}
.fieldset {
background-color: rgba(180, 218, 239, 0.2);
padding: 20px;
margin: 20px;
box-shadow: 10px 5px 5px rgba(0, 0, 0, 0.3);
}
h1 {
font-weight: 800;
}