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 runs correctly through a Web browser. This article focuses on the basics of HTML documents and the frequent use of tags, the content framework for this article, such as the following, but only first describes the HTML Document Foundation:

In the frequently used markup for HTML documents. 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. HTML tags are typically made up of "<", ">", and the markup elements included in them.

For example,:<body></body> is a pair of tokens. This tag is called the principal tag and is used to indicate the principal content in the document.

(1). In HTML Hypertext Markup Language. Most of the tokens are paired. Usually consists of a start tag and an end tag, in which the start tag tells the Web browser to start running the feature 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", and its syntax format is as follows:

< tags > content </tags >

The "content" part of this is the part that is going to work with the tag. For example, the square of the output y in the page. Can be achieved by <sup></sup> tags.

(2). Then attach a "double mark" sample. Start the Dreamweaver CS5 tool, and you can also use other tools to write Web pages. Select HTML in the Create new project, and write code such as the following in the code form:

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

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


Then save this page to this website, the name is changed to sup.html. Performance effects such as the following:

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

In the HTML Hypertext Markup Language. The most frequently used "single mark" is <br>, and this mark is a newline tag. In fact, writing <br/> can also achieve the effect of line wrapping.

(4). Next, attach a "single tag" sample, usually a line in the page to display a piece of text, because this line of text is too long to make the page very ugly, you can use the single mark <br> This paragraph of text into two lines display. 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 ">

And then save it to that JavaScript Web site, change to br.html, and perform the following example:

(5). In the start tag that uses most single and double tags, you can usually include some properties. Its syntax format is:< 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 a space between the attributes, with no order of precedence. Attributes can also be omitted (that is, their default values).

The attribute value needs to be labeled with the English half-width double-cited ("").

(6). Next, enclose a sample 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, for example, the following code:

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

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, and the Width property represents the horizontal line, and the Color property represents the horizontal line.

Save this file to the Web site and change the file name to br.html. Performance effects such as the following:





1.2 The basic structure of HTML documents: Hypertext files written in HTML are called HTML files.

The ability to write HTML files directly in a text editor under Windows, as well as with visual editing software such as FrontPage and Dreamweaver.

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

(2). The following specific description of the functions of the various markers and how to use:

-

End tag

-

Header tags are used to provide a variety of information about Web pages. In the head tag, can use <meta> tag to simulate the HTTP protocol response header message, used to identify the author, annotated content feed and keyword, set the page character set, refresh the page, etc., in the HTML header can contain a random number of <meta> tags; <title>...</title> tag to specify the title of the page; use the <style>...</style> tag to define the CSS style sheet; use <script>...</ Script> tags to insert scripting languages, and so on.

In general, content that is located in the header tag is not displayed directly on the page.

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

As the body part of a Web page, this tag has many built-in properties that are used to set the overall style of the page. For example, define a page's background image, background color, text color, and hypertext link color.

(3). Next, attach a sample using the <font>...</font> tag,<font> tag applied to the HTML file between the body tag <body> and </body>, And only affects the text 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, defines the color as blue through color, and the code such as the following:

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

Save this file for font.html to the Web site. After execution such as the following:



In this example, &lt; and &gt; are used to output the symbols "<" and ">". That is, special code is set in HTML for some special characters. The entity names of the characters start with a "&" symbol, with a ";" The symbol ends. In this sample code, the special symbol "<" is represented by the &lt; tag. The special symbol ">" is indicated by the &gt; tag.

There are also very many special codes. such as the &nbsp; representative space,&quot; for the English half-angle "" double-cited and so on.



Two. This article introduces the basis of the HTML document, the HTML document is often used to mark the next introduction, the above content only for everyone to study, write bad, please forgive me, if there are errors. Please point out, thank you.

The frequent use of tags in HTML documents can be seen in this article: http://blog.csdn.net/u012561176/article/details/46956033, which contains the code for this article.


????

HTML Document Basics

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.