HTML Document Basics

Source: Internet
Author: User
Tags html header dreamweaver

I. HTML (Hyper text Markup Language Hypertext Markup Language) is a simple markup language used to make hypertext documents, HTML writes various tags in the text of the body, compiles and executes through a Web browser to display correctly. This article focuses on the basics of HTML documents and common tags, the content framework of this article is as follows, but only first describes the HTML Document Foundation:

In the common markup of the HTML document, do not draw a multimedia tag, please forgive me!


1.HTML Document Basics:

1.1 HTML markup: HTML is a Hypertext Markup language. Mainly consists of two parts: text and markup. The markup for HTML is usually made up of "<", ">", and the markup elements contained therein. For example,:<body></body> is a pair of tokens, known as a body tag, to indicate the body content in a document.

(1). In HTML Hypertext markup languages, most tags are paired, typically consisting of a start tag and an end tag, where the start tag tells the Web browser to start executing the functionality represented by the tag, and the end tag tells the Web browser to end the feature here. This type of tag is called a "double tag" with the following syntax:

< tags > content </tags >

The "Content" section is the part that will be used by the tag, such as the square of the output y in the page, which can be implemented by the <sup></sup> tag.

(2). Then attach a "double mark" example, launch the Dreamweaver CS5 tool, or use other tools to write Web pages, select HTML in the Create new project, and write the following code in the Code window:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Then create a new site, click on the toolbar's site, and then select:


Then save this page to this site, the name changed to sup.html, the effect is as follows:

(3). Although in HTML Hypertext Markup Language, most of the tags are "double tags", but there are also some are in a separate form of the tag, such tags are called "single tag." This type of marker can be used to express its meaning in its entirety, and the syntax format is:< tag >

In HTML Hypertext Markup Language, the most commonly used "single tag" is <br>, which is a newline tag. Actually writing <br/> can also achieve the effect of line wrapping.

(4). Next attach a "single mark" example, usually in the page with a line to display a paragraph of text, because this line of text is too long to make the page is not beautiful, you can use the single mark <br> this paragraph text into two lines, the code is as follows:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Then still save to that JavaScript site, change to br.html, after running as follows:

(5). In the start tag that uses most single and double tags, you can usually include some attributes in the syntax format of the:< Tag Property 1 Property 2 Property 3...>

In the above syntax, all attributes must be written in the angle brackets "<" of the opening tag, separated by spaces, with no precedence, and attributes can be omitted (that is, their default values). The attribute value needs to be labeled with the English half-width double quotation mark ("").

(6). Next, enclose an example with attributes in a tag, use the single marker <HR> draw a horizontal line in the page, and set its Size property, NoShade property, Width property, and color property, with the following code:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Where the Size property in the code represents the thickness of the horizontal line, the NoShade property indicates that the shadow of the horizontal line is removed, the horizontal line defaults to the hollow shaded stereoscopic effect, the Width property represents the horizontal line, and the Color property represents the horizontal line.

Save this file to the site, change the file name to Br.html, and run the following effect:





1.2 The basic structure of HTML documents: Hypertext files written in HTML are called HTML files. You can manually write HTML files directly in a text editor under Windows, or you can use visual editing software such as FrontPage and Dreamweaver to write HTML documents.

(1). In HTML Hypertext Markup Language, 3 kinds of tags are defined to describe the basic structure of a page. The basic structure in HTML is as follows:

(2). The following details the features and usage of the various tags:

-

-

-<body>...</body> tag: This tag is called the body tag after the head tag

(3). Next attach an example using the <font>...</font> tag,<font> tag applied to the HTML file between the body tag <body> and </body>, and affects only the text that it identifies.

This example defines the font as "bold" through the face property of the <font> tag, defines the size as "16px" through the Size property, and defines the color as blue through color, with the following code:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Save this file as font.html to the site, after running as follows:



In this example, &lt; and &gt; are used to output the symbols "<" and ">", i.e. special code is set in HTML for some special characters. The entity names of the characters begin with a "&" symbol, with a ";" The symbol ends. In this example code, the special symbol "<" is represented by the &lt; tag, and the special symbol ">" is indicated by the &gt; tag. There are a lot of special code, such as &nbsp; represents the space,&quot; for the English half-angle "" double quotation marks and so on.



Two. This article introduces the basis of the HTML document, the common markup of the HTML document is introduced next time, the above content is only for everyone to learn the reference, not written well, please forgive me, if there are errors, please point out, thank you!



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

HTML Document Basics

Related Article

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.