1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "UTF-8" />5 <title>Baidu a bit, you will know</title>6 </Head>7 8 <Body>9 <H1>I am the title</H1>Ten <H2>I am the title</H2> One <H3>I am the title</H3> A <h4>I am the title</h4> - <h5>I am the title</h5> - <h6>I am the title</h6> the <HR/> - <P>I'm a piece of text</P> - <P>I'm a piece of text</P> - + </Body> - </HTML>
This is a standard HTML code, the function is simple. Now let's introduce the HTML to this piece of code.
The first line of <! DOCTYPE Html> This code is for the browser to see, tell the browser this is a piece of HTML code, let the browser to parse
<meta charset= "UTF-8"/> This code declaration character encoding type is UTF-8, and this label is a single label, unlike the code
<title> Baidu a bit, you know </title> this tab set the page title, the specific effect of a run will know
Title Tags
<p></p> paragraph labels, which occupy a whole line of the page
Next we introduce the IMG tag
The IMG tag is an abbreviation of image, and the function is to tell the browser that we need to display a picture
IMG Label format
The path here has a relative path and an absolute path, or it can be a URL link
Width: Set the width of the picture
Height: Set Picture height
If you do not specify a width, the system defaults to the image's wide height display
If you want to specify it manually, it is usually set to one, and the other system adjusts automatically based on the settings. If the width is set together, it may cause the picture to deform
Title: Used to tell the browser that when the mouse hovers over the picture, the contents of the Description box pop up
Alt: Displays the contents of Alt when the picture you want to display is missing
<br/> Label, wrapping label. Rarely used in enterprise development, a whole web page is used up to a few times
<a href= "www.baidu.com" title= "target=" "> Baidu </a>
hyperlink, the href parameter is written in the URL, click this hyperlink will jump to the specified URL
In the middle can also insert an IMG tag, the picture can also become a hyperlink can click to jump to the specified URL
Title: Displays the content of the prompt when the mouse hovers over the link
Target: The value is _self and _blank, when set to self will be in the current page jump, when set to blank will open a new page jump
Where the value in Herf can make # and javascript:;, this time become a fake link, will not reverse any jumps
# The function is usually to let the page back to the top, you can also specify the jump location
For example
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Anchor Point</title></Head><Body><H2>I am the top</H2><ahref= "#center">Jump to Middle</a><!--a tag can also jump to the specified location on the specified page -<P><ahref= "08 Stroke Test interface. Html#bottom"Target= "_blank">Jump to the middle of another page</a></P><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><H2ID= "Center">I'm in the middle.</H2> <!--set the id attribute for the caption to allow a tag to jump -<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR></Body></HTML>
Just add the ID name of the tag you want to jump to after the # number.
JavaScript typically writes JS code behind a colon, with JS
Getting Started with HTML