基本结构
---
HTML(HyperText Markup Language)是用于创建网页的核心语言,其代码基本结构由 DOCTYPE 声明、HTML 标签、头部标签和主体标签组成。

1. DOCTYPE 声明(文档类型声明)
DOCTYPE 声明位于 HTML 文档的最开始,用于告诉浏览器当前文档使用的是哪个 HTML 版本。

html

2. HTML 标签(根标签)
HTML 标签是 HTML 文档的根元素,它包含了整个 HTML 文档的内容。常见的 HTML 标签包括 等。

`html

`

3. 头部标签(Head)
头部标签用于定义关于 HTML 文档的元信息,比如文档标题、引入样式表、引入脚本等。常见的头部标签包括 、`<span class="MathJax_Preview" style="color: inherit;"><span class="MJXp-math" id="MJXp-Span-31"><span class="MJXp-mstyle" id="MJXp-Span-32"><span class="MJXp-mo" id="MJXp-Span-33" style="margin-left: 0.278em; margin-right: 0.278em;">、</span></span></span></span><script type="math/asciimath" id="MathJax-Element-10">、</script><meta><span class="MathJax_Preview" style="color: inherit;"><span class="MJXp-math" id="MJXp-Span-34"><span class="MJXp-mstyle" id="MJXp-Span-35"><span class="MJXp-mo" id="MJXp-Span-36" style="margin-left: 0.278em; margin-right: 0.278em;">等</span><span class="MJXp-mo" id="MJXp-Span-37" style="margin-left: 0.278em; margin-right: 0.278em;">。</span><span class="MJXp-mfrac" id="MJXp-Span-38" style="vertical-align: 0.25em;"><span class="MJXp-box"><span class="MJXp-mo" id="MJXp-Span-39" style="margin-left: 0.333em; margin-right: 0.333em;"><</span></span><span class="MJXp-box" style="margin-top: -0.9em;"><span class="MJXp-denom"><span><span class="MJXp-rule" style="height: 1em; border-top: none; border-bottom: 1px solid; margin: 0.1em 0px;"></span></span><span><span class="MJXp-box"><span class="MJXp-mi MJXp-italic" id="MJXp-Span-40">p</span></span></span></span></span></span><span class="MJXp-mo" id="MJXp-Span-41" style="margin-left: 0.333em; margin-right: 0.333em;">></span><span class="MJXp-mo" id="MJXp-Span-42" style="margin-left: 0.333em; margin-right: 0.333em;"><</span><span class="MJXp-mi MJXp-italic" id="MJXp-Span-43">p</span><span class="MJXp-mo" id="MJXp-Span-44" style="margin-left: 0.333em; margin-right: 0.333em;">></span></span></span></span><script type="math/asciimath" id="MathJax-Element-11"> 等。</p><p></script><span class="MathJax_Preview" style="color: inherit;"><span class="MJXp-math" id="MJXp-Span-45"><span class="MJXp-mstyle" id="MJXp-Span-46"><span class="MJXp-mo" id="MJXp-Span-47" style="margin-left: 0em; margin-right: 0em;"></span></span></span></span><script type="math/asciimath" id="MathJax-Element-12"></script>html</p><head> <title> 页面标题

`

4. 主体标签(Body)
主体标签用于定义 HTML 文档的内容,包括文本、图片、链接等。主体标签必须位于头部标签的后面。常见的主体标签包括 、`

~


`

3. 导入样式表(Stylesheet)
通过 `` 标签可以导入外部的 CSS 样式表文件。

`html

`

4. 引入脚本(Script)
通过 `

`

主体标签
---
主体标签包含了网页的实际内容,包括文本、图片、链接等。

1. 标题(Heading)
标题标签用于定义不同级别的标题,从 `

` 是最高级别的标题,用于表示主标题。

`html

主标题

副标题

三级标题


`

2. 段落(Paragraph)
段落标签用于定义文本内容的段落,通过 `

` 标签可以创建新的段落。

`html

段落一

段落二


`

3. 图片(Image)
图片标签用于插入图片到网页中,通过 ` 图片描述
`

4. 链接(Link)
链接标签用于创建指向其他网页或相同网页中其他元素的链接。通过 `href` 属性)。

`html
跳转链接
`

注意:以上只是主体标签的简要说明,实际可以通过 HTML 提供的各种标签和属性来实现更多不同类型的内容展示。