使用html帮我写一个学生选课界面
时间: 2024-03-05 09:54:35 浏览: 16
好的,以下是一个简单的学生选课界面的HTML代码,你可以自己根据需要进行修改和美化。
```
<!DOCTYPE html>
<html>
<head>
<title>Student Course Selection</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #f1f1f1;
}
* {
box-sizing: border-box;
}
/* Add padding to containers */
.container {
padding: 16px;
background-color: white;
}
/* Full-width input fields */
input[type=text], input[type=password] {
width: 100%;
padding: 15px;
margin: 5px 0 22px 0;
display: inline-block;
border: none;
background: #f1f1f1;
}
input[type=text]:focus, input[type=password]:focus {
background-color: #ddd;
outline: none;
}
/* Set a style for the submit button */
.btn {
background-color: #4CAF50;
color: white;
padding: 16px 20px;
border: none;
cursor: pointer;
width: 100%;
opacity: 0.9;
}
.btn:hover {
opacity: 1;
}
/* Add a blue text color to links */
a {
color: dodgerblue;
}
/* Set a grey background color and center the text of the "sign in" section */
.signin {
background-color: #f1f1f1;
text-align: center;
}
/* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other */
@media screen and (max-width: 600px) {
.col {
width: 100%;
margin-top: 0;
}
}
</style>
</head>
<body>
<h2>Student Course Selection</h2>
<div class="row">
<div class="col">
<div class="container">
<h3>Select Course</h3>
<p>Please select the course you want to take.</p>
<hr>
<label for="course"><b>Course</b></label>
<select name="course" required>
<option value="">Select Course</option>
<option value="Math">Math</option>
<option value="Science">Science</option>
<option value="English">English</option>
<option value="History">History</option>
</select>
<button type="submit" class="btn">Select</button>
</div>
</div>
<div class="col">
<div class="container">
<h3>Selected Courses</h3>
<p>These are the courses you have selected.</p>
<hr>
<ul>
<li>Math</li>
<li>Science</li>
</ul>
</div>
</div>
</div>
</body>
</html>
```