Syntax for HTML introduction, document basic structure, HTML markup

Source: Internet
Author: User
Tags closing tag tag name

first, the introduction of HTML

Hyper text mark-up Language Hypertext Markup Language, is a descriptive markup language (not a programming language), mainly used to describe Web pages (can have images, text, sounds, etc...) ) but no interactivity

How HTML works:

1. Run locally: HTML file opens in browser
2. Remote Access Run: Local browser access to remote server (e.g. tomcal)

The name of the Web page is best not to have Chinese, because the future Web files are saved to the server on the recommendation to use English

When you save an HTML file, you can use the. htm as well as the. html file suffix.

II. basic structure of HTML documents

1, the skeleton of the document: all Web files, usually by the following four pairs of tags to form the skeleton of the document

 <  html     >  <  head         >  <  title  >  page title </ title     >  <  body  >   </ body  >  </ html  >  

the contents are loaded first )
<title>....</title>: Identifying the title of a Web page file
<body>....</body>: Identifies the body part of a Web page file, which is what is visible on the page

2. Meta tags

Meta tags are used to define file information, to describe the Web page, to facilitate search engine lookup, to be placed between

Set keywords: (relatively short, for search engines)
<meta name= "keywords" content= "value"/> value means the keyword to be set, between multiple keywords, separated by
Setting Description: (used to extend the keyword or to provide an overview of the content of the Web page)
<meta name= "description" content= "value"/> value represents the description to be set, with multiple descriptions separated by
Set up
<mate name= "Author" content= "author name"/> Author name is generally the company name
To set the encoding for a webpage:
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
Set Page timing Jump:
<meta http-equiv= "Refresh" content= "2;url=http://www.baidu.com"/> (content= "2;url=http://www.baidu.com" 2 indicates how many seconds the page jumps to the destination specified by the URL)

Describe the version of the Web page:
<meta name= "Revised" content= "html4.01" >
Other Web page information can be set:
<meta name= "Others" content= "This my first website, the main content of the website has animation, music, articles, blogs and so on, welcome everyone to visit! ">

The description page is generated by that software:
<meta name= "generator" content= "Notepad" >

<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><Metaname= "keywords"content= "Web design, Learning Web page" /><Metaname= "description"content= "How to learn Web design, learn Web design methods, HTML Chinese manual" /><Metaname= "Author"content= "Preach Intelligence podcast" /><Metahttp-equiv= "Refresh"content= "2;url=http://www.baidu.com" /><Metaname= "Revised"content= "html4.01"><title>HTML document BASIC Structure _meta tags</title></Head><Body>meta tags are used to define file information, to explain the Web page, to facilitate search engines to find,</Body></HTML>

3. Base tag: Set the target value of the hyperlink

<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>Nesting of frames in HTML</title><BaseTarget= "_blank"/><!--The target property of the base tag can set the target value of the hyperlink for the entire page to be the same, so that you don't need to set the target in each hyperlink tag. -</Head><Body>    <ahref= "Http://www.baidu.com"Target= "_blank">Java</a>    <ahref= "http://www.sina.com.cn"Target= "_blank">Php</a></Body></HTML>

III. syntax for HTML tags

The most basic syntax for HTML is the < tag > content </tag, which is usually an opening tag and a closing tag used in pairs, and a single mark with no end tag, such as

HTML tag types: single and double markers
Double mark:
There is a property:< tag name attribute = "attribute value" >...</tag name > such as: <font size= "3" >.....</font>
No attribute:< tag name >...</tag name > such as:<title>.....</title>

Single mark:
Attribute:< Tag Name attribute = "attribute value" > such as: No attribute:< tag name > such as: <br/>

<!--there is a property:< tag name attribute = "attribute value" >...</tag name > such as: <font size= "3" >.....</font> -    <Fontsize= "4"Color= "#33FF00">2, the sports teacher said: "Who dares to wear a skirt on my class, will punish her handstand!"</Font>         <!--no attribute:< tag name >...</tag name > such as:<title>.....</title> -        <!--Attribute :< Tag Name attribute = "attribute value" > such as:  -    <HRwidth= "$"/>        <!--no attribute:< tag name > such as: <br/> for line break but no change of segment -3, live in my heart, you pay the rent? <BR/>4, you let me off the table, I let you even the opportunity to take the stage did not. 

Syntax for HTML introduction, document basic structure, HTML markup

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.