需求:Web前端開發(fā)技術(shù)完成管理系統(tǒng)后臺(tái)管理功能,主要包括用戶登錄、系統(tǒng)主界面(要求直接跳轉(zhuǎn)到用戶管理界面,可選做一個(gè)系統(tǒng)后臺(tái)管理主界面,用戶管理作為主界面下的某個(gè)子功能,)并實(shí)現(xiàn)一個(gè)具體功能增、刪、改的界面設(shè)計(jì)。
1.用戶登錄
輸入賬號(hào)、密碼。如果賬號(hào)和密碼驗(yàn)證通過,則打開主界面,否則提示錯(cuò)誤。
界面要求
- 賬號(hào),要求長度在6-20個(gè)字符。
- 密碼,要求長度在5-15個(gè)字符。
- 按鈕,登錄,類型submit。
- 要求采用表單提交。
功能要求
點(diǎn)擊“登錄”按鈕,根據(jù)規(guī)則驗(yàn)證輸入的賬號(hào)和密碼,都是必填項(xiàng),有長度限制。根據(jù)自己的情況,可以設(shè)定一個(gè)默認(rèn)的賬號(hào)和密碼作為驗(yàn)證通過的數(shù)據(jù),如賬號(hào)jxf123,密碼為Test_001。
- 表單中action值為user.html。
- 表單method="post"。
?
1.html? 代碼
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>用戶登錄</title>
</head>
<body>
<form action="user.html" name="form1" onsubmit="return check();" method="post">
<div class="user">
<input type="text" name="name" placeholder="用戶名" pattern="^[a-zA-Z0-9_-]{6,16}$" value="jxf123"/>
<input type="password" name="password" placeholder="密碼" pattern="^[a-zA-Z0-9_-]{5,15}$" value="Test_001" />
</div>
<div class="footer">
<div></div>
<input type="submit" name="submit" value="登錄" class="btn" formaction="main.html" />
<input type="submit" name="submit" value="注冊(cè)" class="btn" formaction="register.html" />
</div>
</form>
</body>
</html>
?login 登入頁面? css 樣式
body {
/*?設(shè)置背景圖片不平鋪、水平垂直居中、固定不動(dòng)?*/
background: url(../images/1.jpg) no-repeat center center fixed;
/*?保持圖像本身的寬高比例,將圖片縮放到正好完全覆蓋定義背景的區(qū)域。*/
background-size: cover;
padding-top: 20px;
}
form {
width: 343px;
height: 200px;
margin: 0 auto;
border: 1px solid rgba(0, 0, 0, 1);
border-radius: 5px;
/*?隱藏溢出內(nèi)容?*/
overflow: hidden;
text-align: center;
}
input {
width: 300px;
height: 30px;
border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 4px;
margin-bottom: 10px;
}
.user {
padding-top: 40px;
}
.footer input {
width: 50px;
height: 34px;
}
/*?當(dāng)光標(biāo)放到按鈕上時(shí),鼠標(biāo)指針為一只小手形狀?*/
input[type=submit] {
cursor: pointer;
}
/*?當(dāng)該input元素獲得焦點(diǎn)時(shí),設(shè)置背景顏色及盒陰影?*/
input:focus {
background-color: rgba(0, 0, 0, 0.2);
overflow: hidden;
}
.btn {
border-radius: 4px;
border-radius: 6px;
}
/*?當(dāng)鼠標(biāo)懸浮在該元素時(shí),設(shè)置背景顏色 */
.btn:hover {
background: rgba(0, 0, 0, 0.2);
}
2.注冊(cè)頁面文章來源:http://www.zghlxwxcb.cn/news/detail-410570.html
<form class="contact_form" action="#" method="post">
<ul>
<li class="usually">
<h2>用戶注冊(cè)</h2>
</li>
<li class="usually">
<span>昵稱:</span>
<input type="text" id="name" name="name" autocomplete="off" required pattern="^[a-zA-Z0-9_-]{6,16}$" />
</li>
<li class="usually">
<span>注冊(cè)郵箱:</span>
<input type="email" name="email" autocomplete="off" placeholder="javin@example.com" required />
</li>
<li class="usually">
<span>密碼:</span>
<input type="password" name="password" required />
</li>
<li class="special">
<span>性別:</span>
<input type="radio" name="sex" id="male" checked />
<label for="male">男</label>
<input type="radio" name="sex" id="female" />
<label for="female">女</label>
</li>
<li class="usually">
<span>年齡:</span>
<input type="number" name="age" required />
</li>
<li class="special">
<span>興趣愛好:</span>
<input type="checkbox" id="football" name="interest" />
<label for="football">足球</label>
<input type="checkbox" id="basketball" name="interest" />
<label for="basketball">藍(lán)球</label>
<input type="checkbox" id="swim" name="interest" />
<label for="swim">游泳</label>
<input type="checkbox" id="sing" name="interest" />
<label for="sing">唱歌</label>
<input type="checkbox" id="run" name="interest" />
<label for="run">跑步</label>
<input type="checkbox" id="yoga" name="interest" />
<label for="yoga">瑜伽</label>
</li>
<li class="usually">
<span>自我介紹:</span>
<textarea rows="10" cols="200" name="introduction" placeholder="Please enter your message" class="message"
required></textarea>
</li>
<li>
<input class="submit" type="submit" value="立即注冊(cè)" />
</li>
</ul>
</form>
注冊(cè)頁面? css樣式文章來源地址http://www.zghlxwxcb.cn/news/detail-410570.html
.contact_form {
width: 70%;
margin: 0 auto;
}
.contact_form ul {
width: 750px;
list-style: none;
/*?清除默認(rèn)樣式?*/
margin: 0px;
padding: 0px;
}
.contact_form li {
padding: 12px;
border-bottom: 1px solid #eee;
}
/*?給類名為contact_form的元素的第一個(gè)子元素li和最后一個(gè)子元素li加底部邊框?*/
.contact_form li:first-child,
.contact_form li:last-child {
border-bottom: 1px solid #777;
}
.contact_form span {
width: 150px;
/*?把塊元素強(qiáng)制轉(zhuǎn)換為行內(nèi)塊元素?*/
display: inline-block;
}
/*?給類名為usually的元素下的input標(biāo)簽定義寬高和內(nèi)邊距?*/
.usually input {
height: 20px;
width: 220px;
padding: 5px 8px;
}
/*?該元素獲得焦點(diǎn)時(shí),不出現(xiàn)虛線框(或高亮框)*/
*:focus {
outline: none;
}
/*?給類名為usually的元素下的input和textarea標(biāo)簽設(shè)置背景圖片、內(nèi)陰影和邊框圓角?*/
.usually input,
.usually textarea {
background: url(../images/attention.png) no-repeat 98% center;
box-shadow: 0 10px 15px #eee inset;
border-radius: 2px;
}
.contact_form textarea {
padding: 8px;
width: 300px;
}
/*?當(dāng)該元素獲得焦點(diǎn)時(shí),設(shè)置背景顏色為白色?*/
.usually input:focus,
.usually textarea:focus {
background: #fff;
}
/*?設(shè)置按鈕的樣式?*/
input[type=submit] {
margin-left: 156px;
background-color: #68b12f;
border: 1px solid #509111;
border-radius: 3px;
color: white;
/*?內(nèi)邊距:上下6px、左右20px?*/
padding: 6px 20px;
/*?文本對(duì)齊方式:水平居中?*/
text-align: center;
}
/*?當(dāng)鼠標(biāo)懸停在提交按鈕時(shí),該按鈕背景顏色透明度為0.85,光標(biāo)變成小手?*/
input[type=submit]:hover {
opacity: .85;
cursor: pointer;
}
/*?當(dāng)該元素獲得焦點(diǎn)填寫內(nèi)容無效時(shí),設(shè)置警告背景圖片?*/
.usually input:focus:invalid,
.usually textarea:focus:invalid {
background: url(../images/warn.png) no-repea
到了這里,關(guān)于html+css+js 學(xué)生信息管理系統(tǒng)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!