Mastering CSS: Advanced Web Standard Solution (2nd Edition)--Chapter One basics

Source: Internet
Author: User

"People rarely read the full CSS specification first, and these specifications can send anyone to sleep." ”

"One of the best ways to learn CSS is to start using it directly. ”

"First saw some great results from the blog, so look at the source code to see how they are implemented, and then on their own personal site is a bold attempt." ”

First, from the beginning should pay attention to the basic problems, develop good habits:

1. Good document structure

Don't rely too much on the visual editor; Bad code structure might make you prefer to write pages from scratch rather than look for bugs;

2. Meaningful marking

The semantic tags currently available in HTML 4 are not exhaustive, at least without elements that can be directly used like headers, navigation, footer, and suboptimal solutions that use existing elements and give them additional meaning by adding IDs or class names. For example, make a navigation bar: <ul id= "NAV" >.

3. Easy to understand and maintain

Second, ID and class

Bottom line: The ID is unique and the class is similar .

"Andy-budd is much clearer than Andybudd. ”

1. When naming IDs and classes, be sure to be independent of how they behave.

Poor naming (how it looks): Red,leftcolumn,topnav,firstpara ...

Good name (what it is): Error,secondarycontent,mainnav,intro ...

2. The naming of IDs and classes is case-sensitive, using uniform conventions according to personal habits or requirements.

Mastering CSS: Advanced Web Standard Solution (2nd Edition)--Chapter One basics

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.