HTML入门笔记1

130 阅读1分钟

1、HTML历史

1990年左右,Tim Berners-Lee发明了HTML,他同时发明了WWW,HTTP和URL。

2、HTML起手式

<!DOCTYPE html>
<!--文件类型-->
<html lang="en">
<!--可修改语言,lang="zh-CN"-->
<head>
    <meta charset="UTF-8">
    <!--文件字符编码-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>KOKO2233</title>
    <!--标题-->
</head>
<body>
    
</body>
</html>

3、常用章节标签

  • h1-h6
<h1>标题1<\h1>
<h2>标题2<\h2>
<h3>标题3<\h3>
<h4>标题4<\h4>
<h5>标题5<\h5>
<h6>标题6<\h6>
  • section
<section>章节<\section>
<section>
        第一章
        <section>
            1.1
        </section>
        <section>
            1.2
        </section>
    </section>
  • p
 <p>段落paragraph</p>
  • main
<main>主要内容<\main>
  • aside
<aside>次要内容<\aside>
  • div
<div>区域划分<\div>

4、全局属性

  • class 分类,可对同一个类别的内容统一属性和修改
<p class="xxx">
  • contenteditable 内容可修改
  • hidden
  • id
  • style
  • tabindex

5、常用内容标签

  • ol+li 有序列表
    <ol>
        <li>1</li>
        <li>2</li>
    </ol>
  • ul+li 无序列表
   <ul>
        <li>1</li>
        <li>2</li>
    </ul>
  • pre 固定格式,保留空格和换行
    <pre>
        <p>apple
               banana
                    orange
        </p>
    </pre>
  • a 链接
<a href="xxx.com"></a>
  • em 语气强调

  • strong 内容强调

  • code 代码引用

第一篇博客,以后慢慢完善~冲呀~