CSS recommended in the so-called "top" skills
Snook.Ca to all CSSer recently made some time to write CSS "top skills."
Font size use px
In his statement within the next two CSS contrast:
The following is quoted fragment:
H2 (font-size: 18px; border: 1px solid blue; color: # 000; background-color: # FFF;)
H2 (
Font-size: 18px;
Border: 1px solid blue;
Color: # 000;
Background-color: # FFF;
)
The second did seem like format, but will not have any reading help. In his writing, the faster you can find the necessary parts.
I also wrote before the second similar manner, but gradually discovered as the article said, not much use. Also refreshing, and his party appear in the local paper also enables even smaller.
Writing code block
This code can be written more pages to CSS, when there are problems in the shortest possible time can be found where the problem lies. Like as follows:
The following is quoted fragment:
# Content (float: left;)
# Content p) (…
# Sidebar (float: left;)
# Sidebar p) (…
# Footer (clear: both;)
# Sidebar p) (…
Browser support
Only support for the latest browsers. That is to give up IE5 and IE5.5. As a result we can save a lot of time. IE6 is not for the use of Box Model Hack. If only popular browser, only a small Hack will be able to achieve the same effect.
I pay attention to a new home to the CSS NetEase, which was one! Hack important or not, but in the FF and IE inside show have yielded very good results. Rational use of CSS Hack can be avoided. Of course, debugging time a little more.
Contains all the elements floating in the contents of containers should be designed and containers consistent. If it will be too large sliding to the wrong location. Negative margin adjusted to the use of containers, the same will lead to slip.
Overflow understand if there are two pages of floating elements in the left containers output over the content of containers went to the right will lead to below. This means that your margin, or the width of the padding installed confusion, but not reflected in the FF inside out. Use overflow: hidden or overflow: scroll IE allows content can be avoided out of containers.
Allow blank block elements AutoFill
CSS stands
Many people are margin-top, margin-right, and margin-bottom, margin-left of the use of a pile. In fact, this is the most basic, can be directly used as margin margin: on the left of the right lower. CSS can be seen in the stands summed up.
Avoid unnecessary selector
The style selector reduced to a minimum. If you find yourself constantly write ul li () or () table tr td demonstrated a detailed written too. Fewer selector will let you more easily find the problem.
I did not fully translate, and there are many of them my own, huh.
Original
Tags: div skills, div top, Top Border, Top Border Width, Top Margin, Top Padding






Leave a Reply