Habitual CSS coding sequence

Source: Internet
Author: User

# CSS attribute writing Sequence
// Display attributes
Display
List-style
Position
Float
Clear

// Attributes
Width
Height
Margin
Padding
Border
Background

// Text attributes
Color
Font
Text-Decoration
Text-align
Vertical-align
White-space
Other text
Content

# CSS file writing Sequence
1. Format reset.css
The real benefit of formatting CSS is that it can quickly start the work. You can introduce the framework into the new HTML file,
You do not need to reset the padding and margins to achieve unified layout and the same performance in the browser.

2. layout.css
Define whether the page is two or three columns, whether it is full screen or 1024 × 768 ......
A website may have many la S, but most of them are composed of several reusable la S,
The layout required by selective introduction can quickly apply the expected page layout.

3. Basic style type.css
Defines the font size and color for the body, h1-h6, A: Link-A: active, P, and so on.
CSS reference of the basic style. For example, define ul class as "Ul-text" to display the same icon, line spacing, and link color.
It can also be applied like this: class = "Ul-text square", which shows a square icon before Li.

4. Table modification table.css
Define table, TR, TD, Th, thead, tfoot, tbody, caption, and other labels.
Similar to the basic style, tables are processed in almost all forms on existing websites, so they are stored separately for reference.
For example, apply table-style-1 to a table with a black border, and table-style-2 to a table with a yellow border.

5. Form modifier form.css
Defines the performance of fieldset, label, button, input, select, and textarea labels.
Most websites have almost the same forms, buttons, and input boxes. The reason why CSS is introduced is,
To facilitate uniform display in various browsers.
The default buttons and input boxes are displayed in different browsers. Although they have been initially unified in formatted CSS,
However, the border and button style of the input box must be defined in this CSS. However, the SELECT statement cannot be unified,
If Javascript is used for implementation, the cost is too high.

6. Print and modify print.css

7. CSS containing other CSS
Frontpage.css1_list.css1_detail.css1_register.css, etc.

# Create a css framework folder
A) Core
Save reset.css1_layout.css1_type.css1_print.css

B) Bud Module
Save table.css1_form.css1_album.css and other CSS

C) Specific Application of petal
Stores encapsulated CSS. Frontpage.css1_llist.css1_detail.css1_register.css and other CSS.
CSS stored in this folder is directly referenced.

Related Article

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.