The zero-based HTML tutorial (2): Understanding basic Tags and elements

Source: Internet
Author: User

One, the tags in the HTML

The code for the page that was automatically generated by Dreamweaver on the previous lesson is:

<!doctype html>

<meta charset= "Utf-8" >

<title> Untitled Document </title>

<body>

</body>

"

HTML is a Hypertext Markup language made up of a bunch of tags. The above code altogether has 9 labels.

The label always appears in pairs, where the first character is an English-letter label called the start tag, and the "/" slash sign is called the end tag in the same English front.

Ii. elements in HTML

The content between the start tag and the end tag's ontology is called an element. In the code generated in the previous lesson, "Untitled document" is an element with a start tag and an end tag, and a "untitled document" between tags is the text of this element.

Elements can be nested in other elements. For example, in the above example, the four child elements of ",,," are nested in the element, and "" is their parent element because they are all wrapped in (nested) "" "element.

What does the label in the above example mean?

1.<!doctype html>

This is a special one, not an HTML tag. is used to declare a document type and must be placed before the label. If you don't declare it, the browser uses "weird mode" to render it quirks.

2.

Used to define the beginning and end of a document, which can be understood as a Web page.

3.

As the name suggests, it is the head of a Web page that can modify the title of the page, add CSS stylesheets, and load JavaScript scripts.

4.<title>

Used to define the title of a Web page.

The title on the page is the content.

5.<body>

The theme of the Web page, the content of the user visible on the page is basically to add a change here. If you want to add a text to the page, you have to write it in.

6.<meta>

This defines a Web page that uses UTF-8 encoding and is used in elements. (The label now knows enough)

How to add a few paragraphs to your Web page?

Here to introduce a new label--<p> tag.

<P> is a paragraph label, each <P> element is a paragraph, even if there is a change in the <p> element, the browser will only show a space.

Automatically empty lines between different <P> elements.

As an example:

1. One character is empty in the middle

2. First back Enter change

3. Insert "Paragraph" into a new label

No matter how many spaces or careers you enter in the <p> element, the results are always on the same line, and the text that you want to have on the other line <p> labels will automatically switch.

Five, try to edit a few paragraphs of text and preview the effect of the site it!

Click on the icon in the lower right corner of the software to preview the effect of the page in real time.

The above is the content of this tutorial, a brief introduction of the next HTML basic definitions and tags, and can make a simple text page. Next tutorial will teach you a few common tags to enrich the content of the site!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.