归档:完成 实验一 注册表单

This commit is contained in:
2025-02-26 18:11:25 +08:00
parent ed02926908
commit a214d9684f
6 changed files with 98 additions and 0 deletions
Binary file not shown.
Binary file not shown.
+64
View File
@@ -6,6 +6,12 @@
margin: 0;
}
/* 导入字体 */
@font-face {
font-family: "Marvel-Regular";
src: url("assets/mainform/Marvel-Regular.ttf") format("truetype");
}
/* 设置导航栏样式 */
#navbar {
background-color: rgb(93, 75, 51);
@@ -122,3 +128,61 @@
#nav_search_svg {
padding: 16px 0;
}
/* 设置注册表单居中 */
#main_form {
width: 100%;
text-align: center; /* 新增:水平居中 */
display: flex; /* 新增:启用弹性布局 */
flex-direction: column; /* 新增:垂直排列子元素 */
align-items: center; /* 新增:水平居中子元素 */
padding: 6em 0;
}
#main_title {
padding-bottom: 1em;
color: rgb(240, 120, 24);
font-size: 3em;
font-family: "Marvel-Regular";
font-weight: 500;
}
#main_form form {
width: 50%;
}
#main_form form p {
margin: 4px;
color: rgb(153, 153, 153);
font-size: 0.85em;
align-self: baseline;
text-align: left;
}
/* 设置星号为红色 */
#main_form form p label {
color: rgb(255, 0, 0);
}
#main_form form input {
width: 100%;
height: 3em;
padding-left: 0.5em;
border: 1px;
border-style: solid;
}
#main_form form button {
margin-top: 2em;
border: 2px;
border-style: solid;
border-color: rgb(240, 120, 24);
color: rgb(255, 255, 255);
background: rgb(240, 120, 24);
padding: 0.5em 2em;
}
#main_form form button:hover {
background: rgb(255, 255, 255);
color: rgb(240, 120, 24);
}
+34
View File
@@ -61,5 +61,39 @@
</div>
</div>
</div>
<!--注册表单-->
<div id="main_form">
<h3 id="main_title">注册新用户</h3>
<form action="#" method="post">
<p>用户名<label>*</label></p>
<input
type="text"
name="username"
placeholder="请输入用户名"
required="required"
/>
<p>邮箱<label>*</label></p>
<input
type="email"
name="email"
placeholder="请输入邮箱"
required="required"
/>
<p>密码<label>*</label></p>
<input
type="password"
name="password"
placeholder="请输入密码"
required="required"
/>
<p>收货人</p>
<input type="text" name="name" placeholder="请输入收获" />
<p>收货电话</p>
<input type="text" name="phone" placeholder="请输入收货电话" />
<p>收货地址</p>
<input type="text" name="address" placeholder="请输入收货地址" />
<button type="submit">提交</button>
</form>
</div>
</body>
</html>