第十四周-html、head内标签、body内标签

 1、html标签

<!DOCTYPE html>是统一标准
<html></html>标签只能有一个,标签内部可以写属性
<!--       -->注释
html标签中有:head跟body,如下:
<html>

    <head>   </head>

    <body>   </body>

</html>
2、标签分类

自闭和标签:<meta charset="UTF-8">
主动闭合标签:< title>老男孩</title>

3、head标签

(1)<meta/>:

  a、页面编码:< meta http-equiv=“content-type” content=“text/html;charset=utf-8”>

  b、刷新:< meta http-equiv=“Refresh” Content=“3″>,页面隔3s刷新一次

  c、跳转:< meta http-equiv=”Refresh“ Content=“3″; Url=http://www.autohome.com.cn“ />,当前页面5秒后跳到url页面

  d、关键词与描述:

    <meta name="keywords" content="汽车,汽车之家,汽车网,汽车报价,汽车图片,新闻,评测,社区,俱乐部"/>,
    <meta name="description" content="汽车之家为您提供最新汽车报价,汽车图片,汽车价格大全,最精彩的汽车新闻、行情、评测、导购内容,是提供信息最快最全的中国汽车网站。"/>

  e、IE兼容:<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

  如下:  

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!--<meta http-equiv="Refresh" Content="3">-->
    <!--<meta http-equiv="Refresh" Content="3;Url=http://www.autohome.com.cn">-->
    <meta name="keywords" content="汽车,汽车之家,汽车网,汽车报价,汽车图片,新闻,评测,社区,俱乐部"/>
    <meta name="description" content="汽车之家为您提供最新汽车报价,汽车图片,汽车价格大全,最精彩的汽车新闻、行情、评测、导购内容,是提供信息最快最全的中国汽车网站。"/>
    <title>百度</title>
</head>
<body>
    <a href="http://www.baidudu.com">百度</a>
</body>
</html>

 (2)<title></title>

  网页头部信息,简单来说,就是所打开网页显示的网页名

(3)<link/>

  < link rel="shortcut icon" href="image/favicon.ico">,网页头部图标

(4)<style/>

(5)<script></script> 

4、body标签

(1)&nbsp:空格; &gt:大于; &lt:小于;

(2)<p> </p> 段落:<p>1234</p>  ,1234下一行空行

(3)<br/>换行:<p>123<br/>45</p>   123下一行不空行,5下一行空行

5、h系列

<h1>wu</h1>
<h2>wu</h2>
<h3>wu</h3>
<h4>wu</h4>
<h5>wu</h5>
<h6>wu</h6>
h1到h6是字体从大到小,每个字体占一行

 6、标签分类

(1)块级标签:div(白板,自身不带特性);H系列;P标签

<div>1</div>
<div>2</div><div>3</div>
1、2、3分别显示在不同的三行

 (2)行内标签:span(白板),span不会自动换行

  <span>hello</span>

  <span>hello</span>

  这两个hello会显示在一行

原文地址:https://www.cnblogs.com/wuxiaoru/p/12299789.html