Home > Web Front-end > HTML Tutorial > Basic knowledge of web page production (html) (1) First understanding and attributes of html

Basic knowledge of web page production (html) (1) First understanding and attributes of html

零下一度
Release: 2017-05-05 13:57:36
Original
1120 people have browsed it

1: First introduction to html

<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>
Copy after login

Example explanation

Text description between and Page

The text between and is visible Page content

The text between

and

is displayed as title

and

The text between is displayed as a paragraph

1.1HTML is a language used to describe web pages.

HTML refers to HyperTextMarkupLanguage

HTML is not a programming language, but a markup language

Markup language is a set of markup tags

HTML uses markup tags to describe web pages

1.2HTML markup tags are often called HTML tags (HTML tag).

HTML tags are keywords surrounded by angle brackets, such as

HTML tags usually appear in pairs, such as and < ;/b>

The first tag in the tag pair is the start tag, and the second tag is the end tag

The start and end tags are also called open tags and closing tags

1.3HTML link

HTML link is defined through the tag.


Note: Specify the link address in the href attribute.

1.4HTML images

HTML images are defined through the tag.

Note: The name and dimensions of the image are provided as attributes.

2: html attributes

HTML tags can have attributes. Attributes provide more information about HTML elements.

Attributes always appear in the form of name/value pairs, such as: name="value".

Attributes are always specified in the opening tag of an HTML element.

2.1 Attribute Example

HTML links are defined by the tag. The link's address is specified in the href attribute.

More HTML attribute examples

Attribute example 1:

Defines the beginning of the title.

has additional information about alignment.

TIY: Center the title

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"m.sbmmt.com/TR/html4/loose.dtd">

<html>

<body>

<h1 align="center">This is heading 1</h1>

<p>上面的标题在页面中进行了居中排列。上面的标题在页面中进行了居中排列。上面的标题在页面中进行了居中排列。</p>

</body>
</html>
Copy after login

Attribute example 2:

Defines the body of the HTML document.

has additional information about the background color.

TIY: Background color

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="zh-cn" />
</head>

<body bgcolor="yellow">
<h2>请看: 改变了颜色的背景。</h2>
</body>

</html>
Copy after login

Attribute example 3:

Define HTML table. (You will learn more about HTML tables in a later chapter)

has additional information about the table border.

Always enclose attribute values ​​in quotes

Attribute values ​​should always be enclosed in quotes. Double quotes are the most commonly used, but there is no problem using single quotes.

In some individual cases, such as the attribute value itself contains double quotes, you must use single quotes, for example:

name=&#39;Bill "HelloWorld" Gates&#39;
Copy after login

[Related recommendations]

1 . Free html online video tutorial

2. html development manual

3. php.cn original html5 video tutorial

The above is the detailed content of Basic knowledge of web page production (html) (1) First understanding and attributes of html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template