CSS Basic Properties

Source: Internet
Author: User
Tags color representation

First, CSS common text properties
"Color representation in CSS"
1. The words that use color directly: red, green, blue
2, the use of color hexadecimal representation: #ff0000, #00ff00;
Six-digit, 22-grouping, respectively, representing Red, green, and blue
3, the use of RGB (0~255,0~255,0~255), three-digit, respectively, the proportion of red and green blue.
4, RGBa (); The fourth digit indicates transparency.

Font
1, Font-weight: Font weight, 400 means norml,700 represents bold;
Bold: bold; lighter: fine; You can also use 100-900 values.
2, Font-style: Font style;
Italic: Tilt; norml: normal;
3, font-size: Font size; px can be written in pixels;
200% indicates the browser default size (16px) of twice times =32px;
4, Font-family: Font series, you can write the font name directly, you can also write the system column name.
Common Sub-Body series: serif: Liner body; Sans-serif: non-liner;
You can write multiple values, separated by multiple commas. The first one is preferred, and if there is no font, use it backwards. Usually the last one puts the font family name.
5. Font abbreviation FORM:
Order must be: Font-weight font-style font-sizene-height font-family
Between different attributes, separated by a space;
Font-sizene-height must be a group, used/separated;
Font-family: Between multiple fonts, separated by commas.
"Font Color"
Color: Font colors, can be words, RGB, 16 binary and so on.
Opacity: transparency, selectable value 0-1
"The difference between opacity and Rgba"
The RGBA itself can set the color, and the opacity must be used with other properties,
RGBA is only the color transparency of the current element settings;
Opacity will make all text, background, and child elements in the current element transparent.
Line-height: Row height, can write PX units, can write numbers (indicating the default line spacing several times), can write% (indicating the percentage of default leading)
The important role of row height: to have single-line text centered vertically in the div.
Sets the height of the row =div, which allows the text to be centered vertically.
Text-align: Sets the horizontal alignment of the area's insider level elements, which is not valid for block-level elements.
Letter-spacing: Character Spacing. The distance between the word and the word.
Text-decoration: Text retouching;
Under-line: underline; Over-line: underline; Line-through: strikethrough; none: Remove underline;
Text-overflow: Set the display mode of extra text at the end of line;
Clip: Redundant text cut off; ellipsis: Extra text shows ellipsis (need to match white-space:nowrap; use);
White-sapce:nowrap, set the end of the Chinese line, continue to display.
"Focus" Set the end of the line display ellipsis (three lines of code, indispensable)
Overflow:hidden;
White-space:nowrap;
Text-overflow:ellipsis;

TEXT-SHDOW:2PX (horizontal to right 2 pixels) 2px (vertical 2 pixels) 2px (blur degree, 0 means not blurry) blue; text Shadow,
A positive horizontal shadow distance indicates that the shadow is shifted to the right and the negative indicates the left shift.
Vertical Shadow Distance: A positive number indicates a shadow move down, and a negative number indicates a shadow move up.
Text-indent: First line indent.
-webkit-text-stroke:0.5px blue; text stroke.
-webkit: Indicates that only the WebKit kernel browser is in effect, common Chrome,safari

second, CSS common background properties
1, Background-color: Background color.
2, Background-image:url (); Background image. When the background and background are present, the background color is covered.
3, Background-repeat: Background map repeating mode
No-repeat: Uneven paving;
repeat-x:x axis Tile;
Repeat-y:y axis Tile;
Repeat: tiled;

4, Background-size: background map size;
Specify width Height: can write px, can also write% (parent container width high%)
When writing two attributes, indicate width height, respectively
When writing an attribute, the width is expressed, and the height will be equal to the zoom
Contain: The picture is scaled until the width or height of the large side is scaled to 100%. (may lead to shorter side <100%, picture cannot cover all areas)
Cover: The picture light pen is scaled until it is scaled to 100% by the width or height of the small side. (May cause longer side >100%, resulting in picture not showing)

5, Background-position: Background image offset.
Specified location: Left/center/right top/center/bottom
When you write a value, the other default is centered.
Specify coordinates: Two properties indicate horizontal displacement, vertical displacement, respectively.
The value of the coordinate can be either a pixel unit or a%
When writing pixels px units: Positive shift right, negative shift left, vertical direction: Positive Move down, negative number up.
When writing%: Generally write only positive numbers. Indicates that the width of the image is removed, and the remaining white space is distributed proportionally.
background-position:30% the width of the image horizontally, the remaining area is 3:7 points.

6, "list"
List-style: Modifies the style of the list's small dots.
None: Remove small dots
URL (); You can use a URL to import a small picture, as a list of
Float: Floats can be implemented so that block-level elements are displayed on a single line.

CSS Basic Properties

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.