"Writing high-quality code web front-end development manual" Reading notes-high-quality CSS

Source: Internet
Author: User

1. Quirks mode and DTD

Standard mode: Browser according to specification performance page

Quirks mode: Simulates old browser behavior to prevent old sites from working (in order to be compatible with old-fashioned browser code), Firefox will parse the Web page according to standard mode if it is omitted to write the DTD (document type definition) statement, but it will trigger the weird mode in IE.

The difference between the two models is relatively large, the typical is the analysis of the box model of IE; in standard mode, the width of the page element is determined by the addition of the width of padding, border, and width, while in the weird mode, the width itself includes the widths of padding and border.

2, how to organize CSS?

by function: Font.css color.css layout.css, etc.

Divided by block: Head.css foot.css sidebar.css main.css, etc.

Author's suggestion: Base.css + common.css +page.css

The base layer provides a CSS reset function (overriding the browser default style) and a generic atomic class (text, positioning, length, width, margin), highly portable

Common layer is the site level, different sites have different common layer, the same site has only one common layer; a highly important module in a website called a component

The page layer is at the top level and provides the style

3. Modular CSS

"Writing high-quality code web front-end development manual" Reading notes-high-quality CSS

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.