About the front-end code organization some rude views

Source: Internet
Author: User

For small and medium-sized projects, the lightweight organizational structure is still relatively good;

HTML: Semantic Precedence principle

CSS: Recommended base.css, Common.css, page.css;

Organization style effective management of the entire project CSS, as far as possible to partition the module, there is a certain concept of the namespace, such as:. Timelist-lastitem;

Multi-use combination less inheritance (not even);

Low weight principle (use class as much as possible);

Sprite Technology reduction request;

Commonly used three kinds of hack methods: IE conditional annotation method, selector prefix method, style attribute prefix method;

Trigger Haslayout;

JS: There is a namespace concept that can encapsulate a global object;

The program has a uniform entrance

Layered concept, Base common page

JS Library Selection: JQ basic ability to cope with 98% of development tasks

Some common compatibility issues, focusing on the event node BOM Dom aspect, this, closures and the like ...

Build tools don't use much, try gulp.

    

About the front-end code organization some rude views

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.