How to write more standardized CSS

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Like we do blog class design of their own theme is very fulfilling, but the CSS is particularly important to show, now WordPress is the first domestic introduction of WordPress complete Chinese manual greatly facilitated us. Http://www.wordpress.la/codex.html

Detailed Conceptual Web page framework

Many beginners make a mistake, that is, the basic framework of the Web page has not yet been defined, and began to think about CSS styles, which is causing the CSS style confusion is an important reason. It should be meticulous, precise design of the entire Web page frame, and painting it on paper or in Visio, strictly defined. So we have enough discipline to plan CSS stylesheets.

Use canonical names with good annotation habits

Sometimes the Web pages we make may be long gone, and they may be handed over to others, and that might be a problem. Without a good naming convention and comments, it is likely to cause yourself or the maintenance of the person completely do not know what the meaning of this is written, but also need to study carefully from the beginning, time-consuming consumption.

Therefore, whether for ourselves or for future maintenance, we should use the name of the specification as much as possible to define each class or ID

From outside to inside, from top to bottom, from left to right

This is not so much the development of the basic norms of CSS, rather than the basic way to develop standardized web pages. When we think about web pages, we usually divide the area according to this idea, and in CSS we should also write in this order and annotate the area so that we can find a defined class or ID more easily in our future maintenance.

Complement the style as much as possible to make the page and performance completely separate

8630.html "> Sometimes when we finish the whole page, we still need to add some style, modify it, at this time, we must avoid directly in the page to write" style= ", but must do the page and performance separation, patience will be added to the style sheet. facilitate future maintenance.

Summary

In the initial learning CSS, always like a quick way, very quickly design a set of pages, but look back again, the lack of rules on the page, the style is lack of norms. Therefore, summed up these problems, I hope to work with you to correct their own in the writing CSS problems, more standardized to improve their own CSS style sheet.

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.