HTML page StructureHTML versionSince the inception of the network, there have been many HTML versions:
version |
Release Time |
Html |
1991 |
html+ |
1993 |
HTML 2.0 |
1995 |
HTML 3.2 |
1997 |
HTML 4.01 |
1999 |
XHTML 1.0 |
2000 |
HTML5 |
2012 |
XHTML5 |
2013 |
The version beginning with x is strictly in accordance with the language. It is not recommended.
<! Doctype> statement<! The doctype> declaration helps the web page display correctly in the browser.
There are many different files on the network, and if you can correctly declare the HTML version, the browser will display the content of the Web page correctly.
The DOCTYPE declaration is case-insensitive, and can be used in the following ways:
<! DOCTYPE HTML > <! DOCTYPE HTML > <! DOCTYPE HTML > <! Doctype Html >
General Declaration HTML5<! DOCTYPE HTML >
HTML 4.01
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd " >
XHTML 1.0
<! DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">
Chinese CodeCurrently in most browsers, the direct output of Chinese will be garbled in the case, at this time we need to declare the character in the head as UTF-8.
< Head > <!-- Description: In Meta charset set decoding utf-8 page encoding - < CharSet= "Utf-8"/> <title></ Title></head>
Example
1 <!DOCTYPE HTML>2 <!--3 the HTML version used by the Declaration4 HTML is the only root element5 -6 <HTML>7 <!--8 make some basic configuration of the Web page in the head tag9 -Ten <Head> One <!-- A Description: CharSet set decoding utf-8 in Meta - - - <MetaCharSet= "Utf-8" /> the <!-- - declare the title of the page in title - - - <title>First page</title> + </Head> - <!-- + Description: Write the content of the page in the body A - at <Body> - Hello, world! - Good HTML - </Body> - </HTML>
HTML TitleThe HTML title (Heading) is defined by the
HTML ParagraphThe HTML paragraph is defined by the label <p>.
HTML LinksHTML links are defined by tags <a>.
<href= "http://www.runoob.com"> This is a link </A >
HTML ImagesHTML images are defined by tags .
Example:
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "UTF-8">5 <title></title>6 </Head>7 <Body>8 <!--title -9 <H1>Daojun</H1>Ten <H2>The sword moves Mountains and rivers</H2> One <H3>Magic Day Mind</H3> A <h4>Chen Nan</h4> - <h5>Reckless</h5> - <h6>Dream</h6> the - <!--paragraph - - - <P>At this time the Qing-SLA body in Swallow Yun Ling, surrounded by folk songs</P> + <P>At this time the Qing-SLA body in the Swallow Cloud Ridge,</P><P>Surrounded by folk songs</P> - + <ahref= "Http://www.runoob.com">This is a link</a> A <imgsrc= "Http://p0.so.qhimgs1.com/t016997d986a16ebe7a.jpg"width= "258"Height= "The " /> at - </Body> - </HTML>
--html Day1 for getting started with the front end