Html-related knowledge-front-end cainiao

Source: Internet
Author: User
Html-related knowledge point sorting-front-end cainiao-some problems found when a bear combs html. To sum up, most of the answers are found online.

Differences between yi.html AND htm

There is no essential difference .. In the win32 era, htm is used only when the system recognizes three extensions. Now, we generally use .html.

Ii. Differences between href and src

Src is the abbreviation of source. It points to the location of external resources. The content to which src points will be embedded in the location of the current tag in the document; when a src resource is requested, the resources directed to it are downloaded and applied to the document, such as js scripts, img images, frames, and other elements.


When the browser parses this element, the download and processing of other resources will be suspended until the resources are loaded, compiled, and executed, as will the images and frameworks, it is similar to embedding the resource to the current tag. This is why JavaScript scripts are placed at the bottom rather than the header.

Href is short for Hypertext Reference. It points to the location of the network resource and establishes a link with the current element (Anchor) or current document (Link). If we add

 

The browser recognizes this document as a css file, and downloads resources in parallel without stopping the processing of the current document.

Iii. Differences between using link and using @ import when introducing Cascading Style Sheets

1. Old ancestor's difference. Link is An XHTML label, and @ import is a method provided by CSS.

In addition to loading CSS, link labels can also do many other things, such as defining RSS and rel connection attributes. @ import can only load CSS.

2. Differences in the loading sequence. When a page is loaded (that is, when it is browsed by a browser), the CSS referenced by link is loaded at the same time, the CSS referenced by @ import will be loaded after all the pages are downloaded. So sometimes, when you browse the page where @ import loads CSS, there will be no style (that is, flashing) at the beginning, and the speed is quite slow (mengzhidu loads CSS by using @ import, the above problem occurs when I download and browse the dream capital web page ).

3. Differences in compatibility. Because @ import is proposed by CSS2.1, it is not supported by the old browser. @ import can be identified only when it is later than IE5, but the link label does not have this problem.

4. differences when using dom to control styles. When using javascript to control the dom to change the style, only link labels can be used, because @ import is not controllable by dom.

Iv. Differences between I/em and B/strong

In HTML4.01: <B> <I> is a visual element (presentationl elements), indicating meaningless bold and meaningless italics. The style is {font-weight: bolder}, indicating only "here should be in bold" or "here should be in italic". These two labels are not recommended in HTML4.01;
<Em> and <strong> are elements of expression (phrase elements ). <Em> (emphasized text) indicates general emphasis texts, while <strong> (strong emphasized text) indicates more emphasis texts than <em>.

In the new HTML5 work Draft, <em> and <strong> are still elements of expression (phrase elements ). However, <strong> indicates the emphasis (emphasized text) on the html page, and <em> indicates the emphasis (meaning) in the sentence)

V. Differences between domain names and website names

The domain name and website name are equivalent to the construction on the land. You can build any number of buildings on the land.

Baidu.com // Domain Name

Http://news.baidu.com // The website name consists of the server name + domain name; http is the transport protocol

Http://map.baidu.com/Baidu Map

Vi. Role of meta tags

Elements provide meta-information about pages, such as descriptions and keywords for search engines and update frequency.

The tag is in the document header and does not contain any content. Tag attributes define the name/value pairs associated with the document.

Detailed: http://www.w3school.com.cn/tags/tag_meta.asp

VII. Role of media attributes in link

 
 

The media attribute specifies the device on which the linked document will be displayed.

The media attribute specifies different styles for different media types.

Detailed: http://www.w3school.com.cn/tags/att_link_media.asp

8. Differences between URI, URL, and URN

URL and URN are both subset of URI.

Details: web.jobbole.com/83452/

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.