HTML Knowledge points

Source: Internet
Author: User

1, DOCTYPE is what, examples of common doctype and characteristics
    1. <!doctype>The declaration must be in the head of the HTML document, before the label, HTML5 case-insensitive
    2. <!doctype>The declaration is not an HTML tag, it is an instruction to tell the browser the current HTML version
    3. The HTML layout engine of modern browsers doctype the document by checking whether it is using compatibility mode or Standard mode, and some browsers have a near-standard model.
    4. A DTD is <!doctype> declared in HTML4.01, because HTML4.01 is based on SGML, so the DTD specifies a tagging rule to ensure that the browser renders the content correctly
    5. HTML5 is not SGML-based, so no DTD is specified

SGML is the standard universal labeling language, Generalized Markup language

2. Common block elements and inline elements

1, block-level elements: <div>, <p>,

2. Inline elements: span img Input Select strong

3、常见的空元素: <br> 

Difference: 1, the line elements will be arranged in a straight line, are the same line, horizontal arrangement, block-level elements occupy a row, vertical direction. Block-level elements start at the beginning of the new row and then a line break.

2, block-level elements can contain inline elements and block-level elements. Inline elements cannot contain block-level elements.

3, inline element set width is invalid, height is invalid (can be set line-height), margin is invalid, padding up and down invalid

Why is img and input both inline elements and can I set the width?

because they are empty elements, also known as replaceable elements, these elements often have no actual content, that is, an empty element, the replacement element is the browser based on the element's label and attributes, to determine the element's specific display content. If IMG does not specify W and H, it is displayed according to its intrinsic size. IMG is the original image size, input and type, and the default style of the browser.

3. What is HTML semantics?

 用正确的标签做正确的事情。
html语义化让页面的内容结构化,结构更清晰,便于对浏览器、搜索引擎解析; 即使在没有样式CSS情况下也以一种文档格式显示,并且是容易阅读的; 搜索引擎的爬虫也依赖于HTML标记来确定上下文和各个关键字的权重,利于SEO,便于收录; 使阅读源代码的人对网站更容易将网站分块,便于阅读维护理解。


4、想到再慢慢写----




HTML Knowledge points

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.