Details about html tags (1) and details about html tags

Source: Internet
Author: User

Details about html tags (1) and details about html tags
Http tag details and explanations1. Basic labels

1 <! DOCTYPE html> <! -- Indicates the text type --> 2 
2. Common tags in the body<! ----> Annotation label shortcut: Ctrl + Shift + /, I use the myeclipse <br> line feed label <Strong> </strong> and <B> </B> bold the text

<Em> </em> and <I> </I> tilt the text

<Del> </del> and <s> </s> delete text

<Ins> </ins> and <u> </u> underline the text.

<Pre> </pre> pre-compiled format useful labels
1 <! DOCTYPE html> 2 The running result is as follows:


3. image tags

</img>

1 <! DOCTYPE html> 2 

Annotation: In the </img> label, the src attribute is commonly used to indicate the source and name of the image. The title attribute is used to set the text displayed when the mouse is placed on the image; use the alt attribute to set the description of the image when the image disk cannot be normally displayed; Use the width and height attributes to set the width and height of the image.

The effect is as follows:

4: link tag(1) Introduction to the basic link

<A> </a> label implementation hyperlink

1 <! DOCTYPE html> 2 
Annotation: Use the href attribute to specify the jump address when using the <a> </a> hyperlink. Use the title attribute to set the text displayed when the cursor is placed on the hyperlink; use the target attribute to specify the jump mode of the hyperlink. _ self indicates that the new window is not opened and the page after the jump is opened in the current window (default) while _ blank indicates opening a new window to open the page after the jump.

Details: If all the hyperlink jump methods on a page are consistent, you can configure them in the

<Base target = "_ self"> </base> indicates that all hyperlinks on the page are displayed in the original window.

<Base target = "_ blank"> </base> indicates that all hyperlinks on the page are displayed in the new window.

(2) Use the tag to locate the page

Case: Click back to the top of the page

1 <! DOCTYPE html> 2 
Annotation: When you click to return to the top of the page, the page will be located at the id = "top" tag, and it is at the top. This is through the id attribute positioning, here there are few items in the page, there is no effect. You can add many other labels between the two to test the effect.

(3) download using the tag

Annotation: You can click the link to automatically download the document and compress the file. When you cannot download the image directly, the page will open the image instead of downloading it.
1 <! DOCTYPE html> 2 To download images, you must add one step;
1 <body> 2 <a href = "first.jpg" download = "first.jpg"> click the image </a> <! -- Download implements the image download function --> 3 </body>
5: html framework
1 <! DOCTYPE html> 2 

The following figure shows html1: head.html in the three frameworks.
1 <! DOCTYPE html> 2 2: left.html
1 <! DOCTYPE html> 2 3: center.html
1 <!DOCTYPE HTML>2 The running result is as follows:



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.