HTML Tutorial-html Basic structure

Source: Internet
Author: User
Tags end header integer relative tag name window
Tutorial Hypertext Document The file header and the document body two parts, in the document head, has made the necessary definition to this document, in the document body is the various document information which wants to display.

<HTML>

<HEAD>
Head information
</HEAD>

<BODY>
Document body, body part
</BODY>

</HTML>

Where <HTML> is at the outermost layer, which means that the content between this pair of tags is an HTML document. We'll also see some hompage ellipsis <HTML> tags because. html or. htm files are considered HTML documents by Web browsers. <HEAD> includes the header information of the document, such as the general title of the document, which can be omitted if the header information is not required. <BODY> mark generally does not omit, represents the beginning of the body content.

The following is the source code for the most basic hypertext document:

<HTML>
<HEAD>
<TITLE> A simple HTML example </TITLE>
</HEAD>

<BODY>
<CENTER>
<H3> Welcome to my homepage </H3>
<BR>
<HR>
<font size=2>
This is my first time to do the homepage, no matter how, I will try to do a good job!
</FONT>
</CENTER>
</BODY>

</HTML>

━┓
┃ file Header
━┛

━┓



┃ file Body




━┛

The label in the hypertext

Just contact hypertext, the biggest obstacle to encounter is some use of "<" and ">" surrounded by the sentence, we call it a label, is used to divide and mark the text of the elements to form the layout of text, text format and colorful picture.

1. Single label

Some tags are called "single tags" because they can be fully expressed in a single use, and the syntax of such tags is:

< label name >

The most commonly used single label is <br>, which represents a newline.

2. Double Label

Another type of tag, called a "double label", consists of a "start tag" and a "tail label", which must be used in pairs, where the label tells the Web browser to begin performing the function represented by the tag, and the tail tag tells the Web browser to end the feature here. A trailing slash (/) before the beginning label becomes the tail tag. The syntax for this type of markup is:

< tags > content </tags >

The "content" part is the part that is to be applied to the mark. For example, if you want to highlight the display of a piece of text, place the text in a <EM> </EM> tag:

<EM> First:</em>

3. Label Properties

Many of the first tags of single and double tags can contain properties that are syntactically:

< Tag Name Property 1 Property 2 Property 3 ... >

There is no precedence between attributes, and attributes can be omitted (that is, default values), such as single Mark <HR> to draw a horizontal line at the current position of the document (horizontal line), typically drawn from the most left of the current row in the window to the far right end. With some attributes:

                <HR size=3 align=left width= "75%" > where the SIZE property defines the thickness of the line, the property value is an integer, the missing is the 1;align attribute, the alignment is preferred, left (alignment, default), center (center), Right (right-aligned); The Width property defines the length of the line, the relative value, (the percentage enclosed by a pair of "" numbers, which is relative to the percent full of the window), and the absolute value (the number of screen pixels, such as width=300, represented by an integer), and the default is "100%".


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.