--Read notes, Welcome to error correction ^_^
The content is quite scattered .....
1. How to adapt the height of the floating element's parent container to the height of the element:
<div class= "Clearfix" ><div class= "FL" ></div></div>
/* Meaning is the outermost layer <div></div> is the parent container, add to him the ability to clear the floating, Clearfix code of the more efficient CSS code (1) * *
2. Before you write the code to analyze the module of the page first, the division of the module can also indirectly affect the efficiency of the code, write CSS code partitioning module can follow:
1) The module and the module should not contain the same part, if the same part should be proposed and divided into a separate module;
2) to maximize the reuse of the module, is the module to ensure that the number of modules as little as possible in order to improve the degree of reusability;
3. You may sometimes name a lot when you don't know how to name the box.
1) Camel style: Start with the second word capitalization; (used to distinguish different words)
2) Dash: Use _ or-to connect name; (to indicate affiliation)
Name as much as possible to reflect the subordinate relationship better
These two naming methods are not only used in CSS and then JS or C and other languages also wide to use Ah, small miscellaneous only learned two kinds ... Do not spray .... Still working on it!
Pspsps: If the team to write code, and then write before the team to discuss, everyone has their own unique identifier as a prefix to avoid the conflict of team cooperation code AH!!!
3. Then say a little miscellaneous after the use of a very good experience and feel really wide! --Multiple attempts to use a combination of classes
!!! Remember that there is a time to write more than one page, the code name is self-evident mess, ... Later after the combination of classes modified ... The amount of code is greatly reduced, it looks like a glance!!!
4. It is best to use margin-top or margin-bottom uniformly.
Why? I used to be a mess, and then debugging browser compatibility is an egg! , after modifying the unified margin unexpectedly good! Specifically willing to why. Baidu has Oh ~ ~ ~
If you are not sure that the module's upper and lower margin is particularly stable, it is best not to say that he wrote to the module, but use a combination of classes, separate for the upper and lower margin hanging with the script of the Atom class, and!!! The best modules do not mix with margin-top and Margin-bottom, seemingly this later modified only with padding. Looks better;
Efficient CSS Code (2)