html基础
1.简介
html是一种超文本标记语言(超文本:指图片,音频等文件,标记指<>)
2.组成
html由head和body这二部分组成
<!DOCTYPE>标签
描述:该标签说明浏览器文档使用哪种规范(html和xhtml),避免浏览器的怪异模式
2种模式:1.BackCompat:怪异模式
2.CSS1Compat:标准模式
默认模式为BackCompat(怪异模式)
head部分
meta标签
meta标签:提供页面的元信息,主要用于搜索引擎和更新频度的描述
特点:1.对于用户来说是不可见的
2.位于文档的头部,不包含任何内容
主要有name和http-equiv属性
name属性:主要用于描述网页,与之对于的属性值为content,content的值主要用于搜索引擎机器人查找和分类信息查找
<meta name="keywords" content="测试"> <meta name="description" content="测试学习">
http-equiv属性:相当于http的头信息,与之对应得属性也为content,content值是各个参数变量的值
<meta http-equiv="refresh" content="2;https://www.baidu.com/"> //表示当执行刷新操作2s后自动跳转到百度搜索页面
<meta http-equiv="content-type" charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE7"/> //表示该页面兼容IE7
非meta标签
<title>Title</title> // 标题 <link rel="icon" href="1.png"> //标题前面的图标 <link rel="stylesheet" href="3.css"> //引用css文件 <script >src="3.js" </script> //引用js文件
body部分
<hn>:n的取值为0~6,表示标题
<br>:换行
<p>段落标签
<strong>或<b>:加粗标签
<em>:斜体
<div>:无任何意义,主要用于添加css样式,块级元素
<span>:内联元素,作用于div相同
<src>标签:图形标签
<h1 style="color: blue;background-color: aqua;height: 100px ; width: 50px;font-size: 100px" >测试</h1>
<a>标签:超链接标签
<img src="123.png" alt="test" title="122" height="500" width="633">
<ul>:无序列表
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<ol>:有序列表
<ol>
<li>5</li>
<li>6</li>
</ol>
<dl>:自定义列表
<dl>
<dt>xiao</dt>
<dl>shu</dl>
<dl>ting</dl>
</dl>

浙公网安备 33010602011771号