<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
標籤 | 效果 |
---|---|
<strong>, <b> | 加粗 |
<em>, <i> | 傾斜 |
<ins>, <u> | 下划線 |
<del>, <s> |
<img src="圖像url" alt="替代文字" title="懸停時提示文字>
<audio src="音頻url" control>
屬性:
- controls 控制面板
- loop 循環播放
- autoplay 自動播放
<video src="影片url" controls>
屬性:
- controls 控制面板
- loop 循環播放
- autoplay 自動播放
- muteplay 靜音播放
相對路徑:從 當前文件位置 出發尋找目標
/ 表示進入某個文件夾裡面
. 表示當前文件所在的資料夾
.. 代表上一級
e.g. ../../example/a.jpg 訪問以當前位置為主,上上個資料夾的example裡的a.jpg
絕對路徑:從 硬碟 出發尋找目標(windows從硬碟出發,Mac從根目錄出發)
e.g. F:\User\Desktop\example.jpg
table嵌套tr, tr嵌套 th/td, thead與 tbody則用來使語法更工整
表格最好用来展示数据,而非用来布局
<table align="center" border="1" cellpadding="1" cellspacing="0" width="500" height="500">
<thead>
<tr>
<th> 标题单元格1 </th>
<th> 标题单元格2 </th>
<th> 标题单元格3 </th>
</tr>
</thead>
<tbody>
<tr>
<td> 内文1 </td>
<td> 内文2 </td>
<td> 内文3 </td>
</tr>
</tbody>
</table>
效果:
标题单元格1 | 标题单元格2 | 标题单元格3 |
---|---|---|
内文1 | 内文2 | 内文3 |
标签名 | 含义 |
---|---|
taable |
表格标签 |
thead ,tbody |
标题、内文群组标签 |
th |
[th] 标题标签(自动置中加粗) |
tr ,td |
[tr] 行标签、[td] 内文标签 |
(弃用) 因后续会在
CSS
里设置
align、bgcolor、border、cellpadding、cellspacing
标签名 | 含义 |
---|---|
colspan=数字 |
行合并 |
rowspan=数字 |
列合并 |
<dl>
<dt>名词一</dt>
<dd>名词一释义</dd>
<dd>名词二释义</dd>
</dl>
dl
里只允许有dt
ordd
,但dt
dd
里可以放任何标签
<form action="url地址" method="get/post" name="表单域名称">
method = get | method = post |
---|---|
![]() |
![]() |
/xxx.php?username=syuan19&pwd=a140472 | /xxx.php |
<input type="属性" name="name" value="value" checked="checked">
checked="checked"
可实现选项标签预设选择值
属性 | 描述 | 效果 |
---|---|---|
button | 可点击按钮 | ![]() |
checkbox | 复选框 | 复选1 复选2 |
file | 供文件上传 | |
password | 密码字段 | |
radio | 单选按钮 (禁止复选需定义相同name) | 选项1 选项2 选项3 |
reset | 重置按钮 | |
submit | 提交按钮 | |
text | 单行输入字段,默认20em | |
image | 图像形式的提交按钮 | |
hidden | 隐藏的输入段 |
<input type="text" id="指定id"> <Label for="指定id"> 用户名: </Label>
能实现点击标签名也能选取框元素的功能
代码 | 效果 |
---|---|
<select> <option>选项一</option> <option>选项二</option> <option>选项三</option> </select> | 选项一 选项二 选项三 |
selected="selected"
可实现选项标签预设选择值
效果:
代码 | 效果 |
---|---|
<select> <option>选项一</option> <option>选项二</option> <option selected="selected">选项三 </option> </select> | 选项一 选项二 选项三 |
代码 | 效果 |
---|---|
自我介绍: <textarea placeholder="篇幅120为限" maxlength="120"> </textarea> |
自我介绍:<textarea placeholder="篇幅120为限" maxlength="120"></textarea> |
一般不用,会在
CSS
里改
<textarea cols="100" rows="5"></textarea>
标签名 | 含义 |
---|---|
cols |
每行中的字符数 |
rows |
预设显示的行数 |