Table of Contents
HTML 示例代码
My First Heading
示例代码解释
HTML 标签
Web 浏览器
HTML 页面结构
This is a heading
声明
常见声明
HTML 4.01
XHTML 1.0
HTML 版本
Home Web Front-end HTML Tutorial w3schools 系列教程之 HTML 介绍_html/css_WEB-ITnose

w3schools 系列教程之 HTML 介绍_html/css_WEB-ITnose

Jun 21, 2016 am 08:48 AM

HTML 是一种描述 Web 文档(页面)的标记语言。

  • HTML 代表超文本标记语言(Hyper Text Markup Language)
  • 标记语言就是一组标记标签
  • HTML 文档是由 HTML 标签来描述的
  • 每个 HTML 标记描述了不同的文档内容

HTML 示例代码

<!DOCTYPE html><html>  <head>    <title>Page Title</title>  </head>  <body>    <h1 id="My-First-Heading">My First Heading</h1>    <p>My first paragraph.</p>  </body></html>
Copy after login

示例代码解释

  • DOCTYPE 声明定义将 HTML 文档类型
  • 和 标签之间的文本描述了一个 HTML 文档
  • 和 标签之间的文本提供了有关 HTML 文档的信息
  • 标签之间的文本提供了有关 HTML 文档的标题
  • 和 标签之间的文本描述了可见的 HTML 文档内容
  • 标签之间的文本描述了标题
  • 标签之间的文本描述了段落

通过使用这些描述,浏览器可以显示一个 HTML 文档的标题和段落。

HTML 标签

HTML 标签是包含了一对尖角号的关键词(标签名称):

<tagname>content</tagname>
Copy after login

  • HTML 标签通常是成对的,比如

  • 一对标签中的第一个标签是开始标签,第二个是结束标签
  • 结束标签像开始标签一样编写,只是在标签名称的前面有一个斜杠

开始标签也可以叫做打开标签,结束标签也可以叫做关闭标签。

Web 浏览器

一个 Web 浏览器的作用是读取并显示一个 HTML 文档。一个 Web 浏览器不显示 HTML 标签,而是通过它们来确定如何显示 HTML 文档。

HTML 页面结构

下面是一个 HTML 页面结构的示例:

<html>  <head>    <title>Page title</title>  </head>  <body>    <h1 id="This-is-a-heading">This is a heading</h1>    <p>This is a paragraph.</p>    <p>This is another paragraph.</p>  </body></html>
Copy after login

浏览器只显示 标签区域内的内容。

声明

声明有助于浏览器能够正确地显示 HTML 页面。

网络中具有不同的文档类型。

想要正确地显示 HTML 文档,浏览器必须要知道 HTML 文档的类型和版本。

声明是不区分大小写的,以下所有写法都是正确地:

<!DOCTYPE html><!DOCTYPE HTML><!doctype html><!Doctype Html>
Copy after login

常见声明

HTML5

<!DOCTYPE html>
Copy after login

HTML 4.01

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Copy after login

XHTML 1.0

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Copy after login

HTML 版本

在网络的早期,HTML 就具有了很多版本:

版本 年份
HTML 1991
HTML 2.0 1995
HTML 3.2 1997
HTML 4.01 1999
XHTML 2000
HTML5 2014

本文翻译于《w3schools》网站提供的 HTML 教程。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1657
14
PHP Tutorial
1257
29
C# Tutorial
1230
24
Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? Apr 05, 2025 am 06:15 AM

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

HTML, CSS, and JavaScript: Essential Tools for Web Developers HTML, CSS, and JavaScript: Essential Tools for Web Developers Apr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

HTML: The Structure, CSS: The Style, JavaScript: The Behavior HTML: The Structure, CSS: The Style, JavaScript: The Behavior Apr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web Design The Future of HTML: Evolution and Trends in Web Design Apr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

See all articles