HTML
HTML 超文本标记语言
HTML特征:
- 对换行和空格不敏感
- 空白折叠
1.1 HTML标签
标签也称为标记。
标签的种类:
- 1.双闭合标签
- 2.单闭合标签
1.1.1 head标签
meta 提供基本网站元信息的标签
<meta charset="UTF-8"> <!--标签的属性:使用的编码—'utf-8'-->
title 显示网站的标题
link 链接css资源文件、网站图标
<link rel="stylesheet" href="css/index.css">
script 链接脚本js(java script)文件
<script src="js/index.js">
style 内嵌样式
1.1.2 body标签
1.1.2.1 标题标签
h1~h6标题标签
例:
标题1
1.1.2.2 段落标签
p标签 段落标签
<p>
人们感动于老英雄淡泊名利无私奉献的精神,敬佩老党员一辈子深藏功名、坚守初心的境界大家纷纷表示。
</p>
 ;空格字符
1.1.2.3 超链接标签
a (anchor 锚点)超链接标签
- href :
- 链接到一个新的地址
- 回到顶部
- 跳转邮箱
- 下载文件
- title 鼠标悬浮上的标题
- style 行内样式
- target 目标
- 默认是_self ,在当前页面中打开新的链接
- _blank 在新的空白页面打开新的链接
<a href="https://www.apeland.cn" style="text-decoration:none;color:red; " title="小圆圈">小猿圈</a>
<!--text-decoration:none 去掉链接的下划线-->
<h6 id="top"></h6>
<a href="#top">回到顶部</a> <--跳转到 id="top" 处-->
1.1.2.4 图片标签 img
- src 链接的图片资源的地址
- title 鼠标悬浮时显示的标题
- style
- alt 图片加载失败的时候显示的标题
<img src="images/timg.jpg" alt="校花" width="200" height="300">
<--width 图片宽度,height 图片高度-->
图片可以和超链接合用 a + img:
<a href="https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word=%E6%A0%A1%E8%8A%B1&step_word=&hs=2&" title="美眉">
<img src="images/timg.jpg" alt="校花" width="200">
</a>
1.1.2.5 字体标签
<u> </u>
下划线
<b> </b>
加粗
<strong> </strong>
加粗
<em> </em>
斜体
<i> </i>
斜体
1.1.2.6 特殊字符
:空格 (non-breaking spacing,不断打空格)<
:小于号(less than)>
:大于号(greater than)&
:符号&
"
:双引号'
:单引号©
:版权©
™
:商标?
1.1.2.7 列表标签
1.ul无序列表标签
ul — unordered list
它的子标签是li
type属性:(默认实心圆)
- square 方形
- circle 圆心
<h3>我的teacher</h3> <ul type="square"> <li> <a href="">小米手机</a> </li> <li>女神</li> <li>太白</li> <li>mjj</li> <li>江老板</li> </ul>
2.ol有序列表标签
ol — ordered list
- 它的子标签也是li
- type属性:(默认1,2,3……)
- a
- A
- i
- I
- start属性:定义开始的位置
<h3>我的课程</h3> <ol type="i"> <li>python</li> <li>web前端</li> <li>java</li> <li>linux</li> </ol>
1.1.2.8 表格标签 table
- th定义表头
- tr定义表行
- td定义表单元格数据
<!--border 外边框,cellspacing外边框间的间隙,width宽度填充整个屏幕-->
<table border="1" cellspacing="0" width="100%">
<tr>
<td>id</td>
<td>name</td>
<td>age</td>
<td>sex</td>
</tr>
<tr>
<td>1</td>
<td>沛齐</td>
<td>19</td>
<td>女</td>
</tr>
</table>
1.1.2.9 表单标签form
<1.>form表单
action 定义表单被提交时发生的动作,提交给服务器处理程序的地址(ip、端口);如果是空的字符串,它表示当前服务器地址
method
作用:定义表单提交数据时的方式
提交的方式:
get
默认值,明文提交,所提交的数据是可以显示在地址上,安全性低
提交数据有大小限制,最大为2KB
post
隐式提交-所提交的内容,不会显示到地址栏上,安全性高
无大小限制
<2.>表单控