Talk about HTML

Source: Internet
Author: User

HTML

HTML Explanation:

HTML is an abbreviation for the English Hyper Text mark-up Language (Hypertext Markup Language), which is a standard language (tag) for making Web pages. The equivalent of a uniform set of rules, everyone to abide by him, so that you can let the browser according to the rules of the markup language to explain it.

The browser is responsible for translating the label into a user "readable" format, presented to the user!

# The Hypertext Markup Language is an application under the standard Universal Markup Language and is a specification, a standard that marks individual parts of the page to be displayed by means of marker symbols. The Web page file itself is a text file, by adding a marker in a text file, you can tell the browser how to display the content (such as: How the text is handled, how the picture is arranged, how the image is displayed, etc.). 

The composition of the Web page:

A Web page is usually made up of two parts:

    • HTML (hypertext Markup Language)
    • and CSS (Cascade Style Sheets).

HTML responsible for describing the structure and content of the Web page (e.g. title, navigation bar, etc.) CSS is responsible for the Web page's performance (appearance) (such as background color, font style, etc.).

The content between The content between <body> and </body> is the page effect that the browser renders and the user sees. This means that this is the main body of the page. Which is the body's meaning.

HTML Document

The example code is as follows:

<!DOCTYPE HTML><HTMLLang= "en"><Head>    <MetaCharSet= "UTF-8">    <title>Title</title></Head><Body></Body></HTML>

1, DOCTYPE

DOCTYPE tells the browser what HTML or XHTML specification to use to parse an HTML document

The HTML language requires a standard when we specify the <! in the first line DOCTYPE html> , when a browser accesses our code, it reads and renders the page that we are displaying in accordance with the standard specified in the HTML code.

Why to use <! DOCTYPE html> this to tell the browser???????? :

DOCTYPE mode:

Let's look at the doctype pattern.

    • Backcompat: Standard compatibility mode is not turned on (or is called "weird" mode [Quirks modes], promiscuous mode)
    • Css1compat: Standard compatibility mode is turned on (or called strict mode [standards Mode/strict mode])

The problem arises:

When Netscape4 (the early browser of Netscape) and IE4 (Microsoft's early browser) implemented the CSS mechanism, it did not follow the standards presented by the Web-company. Netscape4 provided poor support, while IE4, though close to the standard, still failed to fully correct the standard of support. Although IE 5 fixes many of the IE4 problems (bugs), it still continues with other failures in the CSS implementation (mainly the box model).

To ensure that their websites are displayed correctly in different browsers, Web developers have to use CSS based on the specifications of each browser. As a result, most Web sites do not conform to the CSS implementation standards.

However, as standard consistency becomes more important, browser developers have to face a difficult choice: the standard of gradual follow-up is the way forward. But changing the implementation of the existing CSS, complete to follow the standard, will make many sites more or less damaged. If the browser suddenly resolves the existing CSS in the correct way, the stale site display will inevitably be affected.

As a result, it can be problematic to follow standards immediately, but ignoring the standards will also keep the chaos of the browser war (a piece of competition between Microsoft and Netscape).

Solution:

    1. Allow Web developers to choose the patterns they know.
    2. Stale Web sites are still displayed using legacy rules.

In other words, all browsers need to provide two modes: quirks mode (i.e. compatibility mode) serves legacy rules, and strict mode serves Standard rules. The Mac platform's IE browser is the first to implement these two modes, Mozilla, Safari, Opera and Windows platform IE6 also successively implemented these two modes. The IE5 and Netscape4 of the Windows platform provide only weird patterns.

Choosing which mode to use requires a trigger, and "Doctyp toggle" is used for this purpose. According to the standard: any one (x) HTML document must have a DOCTYPE: DTD (document type definition) is a set of machine-readable rules that indicate what is allowed in the (x) HTML document, what is not allowed, and what DOCTYPE is used to tell the browser which DTD to use, Usually put in the (X) HTML document at the beginning of the declaration) to tell other people the type of the document style

    1. The Web page that arose before the tide of standardization did not have a DOCTYPE statement. So ' no doctype ' means triggering a weird pattern: rendering Web pages based on legacy CSS rules.
    2. Conversely, if the developer is explicitly aware of the inclusion of DOCTYPE, they should understand what they want to do. As a result, most DOCTYPE declarations will trigger strict patterns: rendering Web pages based on standard CSS rules.
    3. Any new or unknown DOCTYPE will trigger strict mode.
    4. Some pages are written according to the quirks mode, but contain DOCTYPE. In this case, each browser triggers the quirks mode according to its own list of DOCTYPE rules, and compares the chart with the following browser.

Head Section

Talk about HTML

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.