
批改狀態(tài):合格
老師批語:
<img>標(biāo)簽的alt屬性作用:當(dāng)src引用資源不可用時(shí),會(huì)以文本方式顯示,同時(shí)更利用搜索引擎抓取,利于SEO。
<img src="https://img.php.cn/upload/course/000/000/015/61a0a9014ed91862.jpg" alt="第十八期前端開發(fā)">第十八期前端開發(fā)封面</img>
<a>標(biāo)簽href屬性鏈接跳轉(zhuǎn)地址,target屬性跳轉(zhuǎn)打開頁面的位置,默認(rèn)值是_self
ul+li 無序列表,前面的小黑點(diǎn)可以用css來處理。
ol+li 有序列表,不常用。
dl+dt+dd 自定義列表,dl是自定義列表,dt+dd組合==標(biāo)題+名詞解釋。
hr 水平分割線
html標(biāo)簽大全(html5標(biāo)準(zhǔn))
https://www.runoob.com/tags/html-reference.html
鐘老師推薦
HTML(超文本標(biāo)記語言)初學(xué)者教程
https://developer.mozilla.org/zh-CN/docs/Web/HTML
由table+caption+thead+tbody+tfoot 組成。
table 表格標(biāo)簽。
caption 表格標(biāo)題,不要用h2來做,h2是劃分頁面布局時(shí)使用。
thead 表格標(biāo)頭,可省略。
tbody 表格內(nèi)容體,不可省略,避免選擇表格時(shí)選中thead中的tr
tfoot 表格底部,可省略。
tr 代表行
td 代表列,原則是,先行后列。
colspan 表格同行列合并,會(huì)把同行其他列單元格擠出去,直接刪除td即可。
rowspan 表格同列行合并,會(huì)把同列被合并行單元格擠出,需要?jiǎng)h除其他行的td。
效果
代碼:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=table, initial-scale=1.0" />
<title>課程表作業(yè)</title>
</head>
<body>
<table
border="1"
align="center"
cellspacing="0"
cellpadding="5"
width="500"
>
<caption>
<h2>小學(xué)生課程表</h2>
</caption>
<thead bgcolor="green">
<tr>
<th>時(shí)間</th>
<th>周一</th>
<th>周二</th>
<th>周三</th>
<th>周四</th>
<th>周五</th>
</tr>
</thead>
<tbody align="center">
<tr>
<td rowspan="4" bgcolor="#e7f7f7">上午</td>
<td>語文</td>
<td>數(shù)學(xué)</td>
<td>英語</td>
<td>道法</td>
<td>體育</td>
</tr>
<tr>
<td>語文</td>
<td>數(shù)學(xué)</td>
<td>英語</td>
<td>道法</td>
<td>體育</td>
</tr>
<tr>
<td>語文</td>
<td>數(shù)學(xué)</td>
<td>英語</td>
<td>道法</td>
<td>體育</td>
</tr>
<tr>
<td>語文</td>
<td>數(shù)學(xué)</td>
<td>英語</td>
<td>道法</td>
<td>體育</td>
</tr>
<tr>
<td colspan="6">午休</td>
</tr>
<tr>
<td rowspan="3" bgcolor="#e7f7f7">下午</td>
<td>語文</td>
<td>數(shù)學(xué)</td>
<td>英語</td>
<td>道法</td>
<td>體育</td>
</tr>
<tr>
<td>語文</td>
<td>數(shù)學(xué)</td>
<td>英語</td>
<td>道法</td>
<td>體育</td>
</tr>
<tr>
<td>語文</td>
<td>數(shù)學(xué)</td>
<td>英語</td>
<td>道法</td>
<td>體育</td>
</tr>
</tbody>
<tfoot align="center" bgcolor="green">
<tr>
<td>備注</td>
<td colspan="5">每天下午15:30-17:30在校寫完作業(yè)才可回家</td>
</tr>
</tfoot>
</table>
</body>
</html>
lable標(biāo)簽通過for屬性和input的id屬性進(jìn)行綁定,只要兩個(gè)值一樣就完成綁定,實(shí)現(xiàn)點(diǎn)擊lable中的文本后聚焦到input文本框。
required 強(qiáng)制必填項(xiàng)
autofocus 自動(dòng)聚焦
placeholder 提示信息
checked 默認(rèn)選中狀態(tài),多選的時(shí)候多個(gè)lable的name值要相同,從而實(shí)現(xiàn)多選。
效果:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=table, initial-scale=1.0" />
<title>用戶登錄</title>
</head>
<body>
<style>
body {
text-align: center;
background-color: rgb(48, 153, 48);
}
.login {
display: inline-block;
margin-top: 2em;
}
.login .group {
border: 1px solid #ccc;
box-shadow: 0 0 5px #888;
padding: 1em 3em;
background-color: rgb(147, 211, 147);
border-radius: 0.5em;
display: grid;
}
.login .group .title {
padding: 0.5em 1.5em;
background-color: rgb(147, 211, 147);
text-align: center;
box-shadow: 3px 3px 3px #888;
border-top-left-radius: 1em;
border-bottom-right-radius: 1em;
}
.login .group .userinfo {
display: grid;
gap: 1em;
}
.login .group input {
border: none;
border-bottom: 1px solid;
background-color:rgb(147, 211, 147);
outline: none;
}
.login .group .submit {
border: none;
outline: none;
height: 2.2em;
background-color: seagreen;
color: white;
color: black
width: 81%;
margin-top: 1em;
margin-left: auto;
}
.login .group .submit:hover {
cursor: pointer;
background-color: coral;
box-shadow: 0 0 3px #888;
transition: 0.3s;
}
</style>
<form action="login.php" method="post" class="login">
<fieldset class="group">
<legend for="" class="title">用戶登錄</legend>
<div class="userinfo">
<div>
<label for="email"
>郵箱:
<input
type="email"
value="admin@php.cn"
placeholder="請?zhí)顚懹脩羿]箱"
id="email"
required
name="email"
autofocus
/>
</label>
</div>
<div>
<label for="password"
>密碼:
<input
type="password"
placeholder="請?zhí)顚懹脩裘艽a"
id="password"
required
name="password"
/>
</label>
</div>
</div>
<div>
<button class="submit">提交</button>
</div>
</fieldset>
</form>
</body>
</html>
抄寫記錄
<!DOCTYPE html>
<html lang="zh-CN">
<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>內(nèi)聯(lián)框架元素的小應(yīng)用:后臺(tái)</title>
<style>
body {
height: 100vh;
width: 100vw;
display: grid;
grid-template-columns: 10em 1fr;
grid-template-rows: 6em 1fr;
margin: 0;
}
body .header {
grid-column-end: span 2;
border-bottom: 1px solid currentColor;
background-color: #efe;
padding: 2em;
display: flex;
align-items: center;
}
body .header div {
margin-left: auto;
}
body .nav {
background-color: #efc;
margin: 0;
padding-top: 1em;
list-style: none;
}
body iframe {
width: calc(100vw - 10em);
height: calc(100vh - 6em);
border-left: 1px solid currentColor;
}
</style>
</head>
<body>
<!-- 后臺(tái)頂部 -->
<div class="header">
<h1>網(wǎng)站后臺(tái)管理</h1>
<div>
<span>admin</span>
<a href="logout.php">退出</a>
</div>
</div>
<!-- 左側(cè)導(dǎo)航 -->
<ul class="nav">
<li><a href="demo1.html" target="content">菜單項(xiàng)1</a></li>
<li><a href="demo2.html" target="content">菜單項(xiàng)2</a></li>
<li><a href="demo3.html" target="content">菜單項(xiàng)3</a></li>
<li><a href="demo4.html" target="content">菜單項(xiàng)4</a></li>
<li><a href="demo5.html" target="content">菜單項(xiàng)5</a></li>
</ul>
<!-- 右側(cè)內(nèi)容 -->
<iframe src="" frameborder="0" name="content"></iframe>
</body>
</html>
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號(hào)
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)