HTML knowledge point carding (I.)

Source: Internet
Author: User
Tags closing tag

One: what is HTML

HTML (hypertext mark-up Language) is a Hypertext Markup Language or hypertext Tag language

What is hyper Text : Hypertext allows you to include images, links, and even music, programs, and so on in your pages.

The Web page file itself is a text file that marks sections of the page to be displayed by marking symbols.

what is a tag : When the browser encounters the corresponding tag symbol, the corresponding function is implemented!

Web page file extension:. html. htm


--------------------------------------------------------------------------------------------------------------- -------------------------------------

Two: HTML file structure

<body></body> <!--the body part of an HTML file--


--------------------------------------------------------------------------------------------------------------- -------------------------------------

Three: Label classification

    • Labels are mainly divided into bilateral labels (innerHTML can only obtain the contents of bilateral labels) and unilateral labels
    • HTML tags are usually paired (bilateral labels), such as <div> and </div>
    • The first label in the Bilateral tab is the start tag, and the second tag is the end tag;
    • There are also individually presented labels (single-sided labels), such as: <br/>,
    • A bilateral label with content in the middle of two labels. such as
    • A single-sided label whose contents are assigned in the label attribute. <input type= "text" value= "button"/>

the difference between block-level labels and inline labels :

1) block-level elements

Occupy a line, cannot be tied to any other element

Can accept wide, high

If you do not set the width, the width defaults to 100% of its parent element.

2) in-line elements

Parallel to other inline elements

Cannot set width, height. The default width is the width of the content.

Block-level elements: p, h1~h6 layout labels are generally belong to block-level elements

Inline elements: B, I, U, font, SUP, sub text-decoration tags are generally part of the inline element


--------------------------------------------------------------------------------------------------------------- -------------------------------------

Writing Rules
    • HTML tags are keywords surrounded by a pair of angle brackets, such as
    • Label names are case-insensitive but are recommended for lowercase <font> <FONT> <Font>
    • If there is a space between the attribute attribute and the label name in the tag, if there is more than one attribute in a tag, there is a space between the property and the attribute to be written in the start tag that cannot be written in the closing tag.
    • If the value of the attribute attribute in the label is a single quotation mark and double quotation marks that need to be quoted, you can
    • Each label needs to be closed, and one-sided labels need to be closed with backslashes!

Nesting between labels and tags can only be nested using order nesting cannot cross nesting

A label can have several properties, or it can have no attributes. If the


--------------------------------------------------------------------------------------------------------------- -------------------------------------

Four: Notes

Why write comments?

For example: It is convenient for other programmers in the project group to understand your code, and it is convenient for you to understand and modify your own code later on.

You can add your own comments to the HTML document. Comments are not displayed on the page, it can be used to remind the programmer to recall related program information.

Format of comments:

<!-the contents of the comment--


--------------------------------------------------------------------------------------------------------------- -------------------------------------

Five: Character entities

In HTML, some characters are reserved.

The less than sign (<) and greater than sign (>) cannot be used in HTML because the browser mistakenly considers them to be labels.

If you want to display reserved characters correctly, we must use the character entity in the HTML source code.

Space

&nbsp;

>

&gt;

<

&lt;

&

&amp;

&yen;

Copyright

&copy;

Registered

&reg;

X

&times;

÷

&divide;

HTML knowledge point carding (I.)

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.