HTML之 一 标签


一 ,标签分类:

1.普通标签:

hello

hello

2.自闭和标签



二,书写html注意事项

1.标签不能交叉嵌套

2. 标签推荐使用小写

3.标签应该缩进

三,标签的属性:

1. 通常以键值对形式出现,并且放在开始标签中 例如(id="kaka")

<h1 id="kaka">  hello h1>

2.属性名都是小写的例如: id

3.特殊的属性,属性名 与属性值一样,只写属性名即可

<input readonly>  
等同于 <input readonly="readonly">

标签简介:

1. 标签:

提示浏览器以W3C标准模式解析

如果不加,浏览器将以非标准模式解析

 2. 中的标签:

标签与非

a.标签 属性: http-equiv 和 name

name属性:

<head>
    <meta name="keywords" content="程序员 it">   (爬虫关键字)
    <meta name="description" content="博客园是xxxx..."> (爬取后显示的描述)
head>

http-equiv属性:

<meta http-equiv="Refresh" content="2;URL=https://www.baidu.com"> //(注意后面的引号,分别在秒数的前面和网址的后面,如果没有网址就会在秒数内自动刷新当前页面)
<meta http-equiv="content-Type" charset=UTF8"> //(以何种文件模式解析)
<meta http-equiv = "X-UA-Compatible" content = "IE=EmulateIE7" />  //(IE 兼容到ie7,只对ie浏览器有效)

b.非

1. 网页的title文字

<title>hello title>

2.引入资源 

网页的title图片(必须是ico图片)引入

<link rel="icon" href="girl.ico">  // 本地路径的图片
<link rel="icon" href="http:////www.jd.com/favicon.ico">  //网上路径图片

还可以引入css

3.引入js

 3. 中的标签:

 a.

标题标签

b.

  段落标签

c. 最重点之

是块级标签(block标签,占满整行) & 是内联标签(In-line标签,一行内可以放多个)

DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    
    
    <title>Titletitle>
    <style>
        div{
            color:#cc3399;
            background-color: yellow;
        }
        span{
            color: green;
            background-color: yellow;
        }
    style>
head>
<body>
    hello before <div>hello divdiv> hello after <br/>
    span before <span>hello spanspan> span after
body>
html>

 其它标签:

    <b>  字体加粗 b>
    <em> 斜体字 em>
    <strike>划除标签strike>
    <del>划除标签推荐del>
  23 //下脚标
  23 //上脚标
 

特殊符号:

  hello   li   //   空格符
  ©             //© 版权符号
 <;h1>; //<;小于号 >;大于号