Common css code meanings and css meanings
1. font: 12px Arial, Helvetica, sans-serif;
The full code should be: font-size: 12px; font-family: Tahoma; The font is 12 pixels in size, and the font is Arial, Helvetica, and sans-serif;
2. margin: 0px;
The complete code is: margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; or margin: 0px 0px 0px 0px; the order is top/right/bottom/left. If auto is used, the margin is automatically adjusted,
There are also the following statements:
Margin: 0px auto;
It indicates that the top and bottom margins are 0 PX and the left and right sides are automatically adjusted;
In the future, the padding attributes used have many similarities with margin. Their parameters are the same,
However, their meanings are different. margin is an external distance while padding is an internal distance.
Margin: 1px 10px 3px; equivalent to 1px 10px 3px 10px
It indicates that the top margin is 1px, the left margin is 10px, and the bottom margin is 3px.
The rules are as follows:
If the left margin value is missing, the right margin value is used.
If the value of the margin is missing, the value of the margin is used.
If the value of the right margin is missing, the value of the top margin is used.
3. background: # ccc url('bg.gif ') top left no-repeat;
Fill the entire layer with #ccc(grayscale) and use bg.gif as the background image,
Top left
Indicates that the image is located at the top left of the current layer, and no-repeat indicates that only the image size is displayed without filling the entire layer.
Top/right/bottom/left/center
It is used to locate the background image, indicating the upper/right/lower/left/middle. You can also use
Background: url('bg.gif ') 20px 100px;
The X coordinate is 20 pixels, And the Y coordinate is 100 pixels;
Repeat/no-repeat/repeat-x/repeat-y
Fill the entire layer/not fill/fill along the X axis/fill along the Y axis respectively.