html笔记
网页结构
<!DOCTYPE HTML>
:告知浏览器使用h5规范解析<html>
:一个页面只能有一对,代表网页的开始和结束<head>
:头部,<body>
:主体<title>
:标题<meta charset="utf-8">
:页面使用编码
文本标签
b
/strong
/i
/em
/s
/del
/u
/mark
- 上标字:
X<sup>2<sup>
;下标字:Y<sub>1<sub>
<p>
/<h1>~<h6>
/<hr>
/<br>
/lorem
(假文)
转义符号
- 版权声明:
©
/注册商标:®
/商标符号:™
- 乘号:
×
/除号:÷
/大于:>
/小于:<
- 空格:
/上箭头:↑
标签
div
/span
img
:src
/alt
/width
/height
a
:href
/target_self/_blank
- 列表
1.ol
1.li
:start
/type(值为disc/circle/square/none)
2.ul
1.li
3.dl
1.dt
1.dd
table
:border
/border-collapse:collapse
1.caption
2.thead
1.tr
1.th
3.tbody
1.tr
1.td
:colspan
/rowspan
form
:action
1.input
:name
/value
1.type="text/password"
:maxlength
/placeholder
/value
2.type="submit/reset/button"
:value
3.type="radio/checkbox"
:name
/value(必写)
/checked
4.type="file"
:multiple
5.type="number"
:step
/min
/max
6.type="color"
7.type="date"
(年月日)
8.type="month"
(年月)
9.type="week"
(年周)
10.type="search"
11.type="range"
:step
/min
/max
2.button
3.select
1.option
:value
/selected
/multiple
4.textarea
:rows
/cols
/resize:none
5.label
:for(被关联控件id)
iframe
:src
/width
/height
/scrolling="no"
/frameborder="0"
- 语义化标签
1.header
(头部)
1.nav
(导航)
1.section
(网页主体)
1.aside
(侧边栏)
1.article
(文字相关,比如论坛,回帖)
1.footer
(尾部)- 多媒体标签
1.video
:src
/controls
1.audio
:src
/controls