HTML常用标签
HTML和CSS是两种完全不同的语言
我们学的是结构 就只写HTML标签 认识标签就可以了
文字标签
< h1> 一级标题</ h1>
< h6> 六级标题</ h6>
< font size = " 2" color = " red" face = " 黑体" > 字体大小、颜色、样式</ font>
< b> 字体加粗</ b>
< i> 字体斜体</ i>
< u> 字体斜体</ u>
< kbd> 用粗体等宽字体显示文字</ kbd>
< var> 用较小的固定宽度显示字体</ var>
< dfn> 用于名词解释 斜体显示</ dfn>
2< sup> 3 上标</ sup>
co< sub> 2 下标</ sub>
< em> 强调</ em>
< address> 模拟信封上的字体</ address>
< strong> 加强</ strong>
< s> 删除线 给字体上加上一条线</ s>
< big> 比默认字号大一号</ big>
< small> 比默认字号小一号</ small>
< code>
以等宽字体显示计算机程序代码
int num = 1;
System.out.println(num);
</ code>
< hr />
< hr color = " green" width = " 200px" size = " 2" noshade align = " left" >
< br />
分段前< p> 文本内容分段</ p> 分段后
空格
< <
> >
& &
" "
排版标签(左 中 右)
< font align = " left" > 内容</ font>
< center>
内容< br>
内容< br>
内容< br>
</ center>
背景标签
< body bgcolor = " blue" >
</ body>
< body background = " img/夕阳.jpg" >
</ body>
列表标签
< font color = " red" size = " 5" > 我们今天的计划</ font>
< ul type = " square" >
< li> 起床</ li>
< li> 吃饭</ li>
< li> 睡觉</ li>
</ ul>
< ol type = " 1" start = " 1" >
< li> 起床</ li>
< li> 吃饭</ li>
< li> 睡觉</ li>
</ ol>
< dl>
< dt> 自定义列表的标题</ dt>
< dd> 自定义列表的描述内容</ dd>
</ dl>
图片标签
< img src = " img/夕阳.jpg" width = " 300px" height = " 200px"
border = " 3" title = " 这是一幅美丽的夕阳" alt = " 图片不存在" >
超链接标签
< a href = " https://www.baidu.com" target = " _self" > 进入百度</ a>
< a href = " https://www.163.com" target = " _blank" > 进入网易</ a>
锚点链接标签
目录
< a href = " #three" > 第三章</ a>
< a name = " one" > </ a>
< h2> 第一章</ h2>
< a name = " two" > </ a>
< h2> 第二章</ h2>
< a name = " three" > </ a>
< h2> 第三章</ h2>
表格标签
< table width = " 500px" height = " 500px"
border = " 1" bordercolor = " red" cellspacing = " 0"
align = " center" bgcolor = " blue" background = " img/夕阳.jpg" >
< tr>
< td> </ td>
< td> </ td>
</ tr>
< tr>
< td> </ td>
< td> </ td>
</ tr>
</ table>
合并单元格
< table width = " 300px" height = " 300px" border = " 1" cellspacing = " 0" >
< tr>
< td rowspan = " 2" > aaa</ td>
< td> bbb</ td>
< td> ccc</ td>
</ tr>
< tr>
< td> bbb</ td>
< td> ccc</ td>
</ tr>
< tr>
< td colspan = " 2" > aaa</ td>
< td> ccc</ td>
</ tr>
</ table>
表单标签
< form action = " #" method = " GET" >
用户名:< input type = " text" name = " username" value = " " placeholder = " 请输入用户名" required = " required" maxlength = " 10" minlength = " 3" />
< br>
密码:< input type = " password" name = " password" value = " " placeholder = " 请输入密码" />
< br>
邮箱:< input type = " email" name = " user_email" placeholder = " 请输入邮箱" />
< br>
性别:< input type = " radio" name = " sex" value = " 1" id = " men" checked = " checked" /> < label for = " men" > 男</ label>
< input type = " radio" name = " sex" value = " 0" id = " women" checked = " checked" /> < label for = " women" > 女</ label>
< br>
爱好:< input type = " checkbox" name = " hobby" id = " lq" value = " lq" /> < label for = " lq" > 篮球</ label>
< input type = " checkbox" name = " hobby" id = " zq" value = " zq" /> < label for = " zq" > 足球</ label>
< input type = " checkbox" name = " hobby" id = " pq" value = " pq" /> < label for = " pq" > 排球</ label>
< br>
学历:< select name = " xueli" >
< option value = " " selected = " selected" > 请选择你的学历</ option>
< option value = " xx" > 小学</ option>
< option value = " zx" > 中学</ option>
< option value = " dx" > 大学</ option>
</ select>
< br>
生日:< input type = " date" name = " birthday" value = " " />
< br>
你有几个女朋友:< input type = " number" name = " girlfriend" value = " 0" min = " 0" max = " 10" />
< br>
你喜欢的颜色:< input type = " color" name = " color" value = " " />
< input type = " submit" value = " 提交" >
< input type = " reset" value = " 重置" >
</ form>
框架标签
frameset标签
< frameset rows = " 20%,80%" >
< frame src = " http://www.163.com" noresize >
< frameset cols = " 25%,75%" >
< frame src = " http://www.163.com" noresize >
< frame src = " http://www.163.com" noresize >
</ frameset>
</ frameset>
< noframes> 对不起 你的浏览器版本过低</ noframes>
iframe标签
< iframe src = " //player.bilibili.com/player.html?aid=299466669&bvid=BV1MF41157V9&cid=732175662&page=1"
scrolling = " no" border = " 0" frameborder = " no" framespacing = " 0" allowfullscreen = " true" > </ iframe>
< iframe src = " http://www.163.com" scrolling = " yes" border = " 0" frameborder = " no" framespacing = " 0"
allowfullscreen = " true" > </ iframe>
视频音频标签
< video src = " mp4/元芳-五杀时刻.mp4" height = " 300px" width = " 500px" controls = " controls" > </ video>
< audio src = " mp3/李荣浩 - 自拍 (Live).mp3" controls > </ audio>