css|xhtml| Web page
We use xhtml+css page layout, to achieve the separation of performance and structure, the performance of the CSS file is very important, but also more complex, we write CSS file with a lot of attributes and values, we take into account the problem of writing order.
Sometimes it is to write margin or color first, then write width and height and so on. Do we need to make our code more neat and more scientific? Practice has proved that writing neatly, according to certain rules of writing is very good.
The following is the order of CSS written by Mozilla Firefox, which is of reference value to our code writing:
* mozilla.org Base Styles
* Maintained by Fantasai
* (classes defined in the Markup guide-http://mozilla.org/contribute/writing/markup)
*/
/* Suggested Order:
Display Properties
* Display
* List-style
* Position
* Float
* Clear
Own properties
* Width
* Height
* Margin
* Padding
* Border
* Background
Text properties
* Color
* Font
* Text-decoration
* Text-align
* Vertical-align
* White-space
* Other text
* Content