Home >Web Front-end >HTML Tutorial >css3 new attribute API_html/css_WEB-ITnose
Written in front: Since the CSS5 standard has not yet been fully finalized, browsers with various cores have their own standards. In order not to confuse attributes, each browser adds the following in front of their own standards: a prefix.
The following mainly summarizes the new attributes of CSS3 from the aspects of color, text, selector, etc.
Colorcss1 and css2 can only express color in the following three ways
eg:color:red
(Syntax: #RRGGBB or #RGB The value range of each point is 00- FF)
logue 0%~200%)
CSS3 cannot express transparency in the above mode, and the following expression method has been added
Syntax: RGBA(R,G,B,A) R red G green B blue A transparent
The value of each point is similar to RGB. The value of A is between 0 and 1
eg: rgba(255,0,0,0.5) represents translucent red
Syntax: HSL(H,S,L) H hue S saturation L brightness
The value of H is between 0 and 360. 0 or 360 means red, 120 means green and 240 means blue.
The values of S and L are both between 0% and 100%
The syntax and values of each point are the same as those of HSL mode. The only difference is that the A at the end represents transparency
eg:hsl(360,50%,50%,0.5 ) Red
Secondly, you can use color:transparent and filter:alpha(opacity=50) in css3 (no filter is only limited to IE)
TextThe commonly used text attributes in css1 and css2 are
The commonly used text attributes in css3 are
The following will introduce a css3 text attribute
Function: Set the text processing method when the content overflows.
Value:
clip: Default value
When the text in the object overflows, the omission mark (...) will not be displayed, but the overflowing part will be cropped. .
ellipsis:
Displays an ellipsis mark (...) when the text within the object overflows.
Note: This attribute needs to be used in conjunction with the over-flow:hidden attribute (out of processing) and white-space:nowrap (disable line breaks), otherwise the effect will not be seen
Function: Set text alignment
Value:
left: Default value content is left aligned.
Center: The content is centered.
Right: Content is aligned to the right.
Justify: Justify the content on both ends. At the time of writing this document, only Firefox can see the correct effect
Start: The content is aligned to the starting boundary. (CSS3)
End: Content alignment end boundary. (CSS3)
Function: Set the capitalization and other forms of text conversion
Value:
none: Default value No conversion
capitalize: Convert the first letter of each word to uppercase
uppercase: Convert to uppercase
lowercase: Convert to lowercase
full-width: Set the left and right characters to full-width form (CSS3) not supported
full-size-kana: Convert all small kana characters to normal kana (CSS3) not supported For example: Turkish.
Function: Set text decoration line.
Value:
[ text-decoration-color]:
specifies the color of text decoration.
[ text-decoration-line ]: does not support
Specify the type of text decoration line. Equivalent to the text-decoration attribute
[ text-decoration-style] in CSS1:
is not supported to specify the style of text decoration.
blink: The decoration of the specified text is blinking. Only opera and firefox
For example: text-decoration : overline CSS1 instance
text-decoration : #F00 double overline CSS3 instance
Function: Set the position of the text modification line.
Value:
none: Default value
The specified text has no decoration
underline:
The decoration of the specified text is underline
overline:
The decoration of the specified text is an overline
line-through:
The decoration of the specified text is a through line
Function: Set the color of text decoration lines
Value: Specify color.
Function: Set the style of text decoration lines.
Values:
Function: Set the shadow effect of text
Value:
none: Default value No shadow
Function: Text fill color, specify the color of the text fill part
Value: Color
Note: To use this attribute, you need to use the browser prefix
Function: text border color, specify the color of the text stroke part
takes Value:
Set or retrieve the stroke thickness of the text in the object
Set or retrieve the stroke color of the text in the object
Note: Using this attribute requires using the browser prefix
Function: Specifies the width of the stroke part of the text. The derived attribute of text-stroke
Value: length
Note: Using this attribute requires the browser prefix
functions: specifies the color of the stroke part of the text. The derived attribute of text-stroke
value: color
Note: required to use this attribute The browser seems to have the prefix
. Its function is to set the display length of a tab indent key on the page.
Value: Default value: 8 (length or integer value)
Explanation: Integer value: z-index:1 1 here is an integer value, no unit is needed, similar to a multiple .
Length: margin:10px where 10px is the length value.
Note: This attribute is only valid when displayed within the
tag (preformatted state). Because the browser automatically ignores whitespace characters.Opera and Firefox need to use browser private prefixes.
word-wrap attribute
Function: How to handle overflow text (especially English-like text).
Values:
Allow content to push or overflow the specified container boundaries.
Line breaks are allowed within words if necessary.
SelectorElement Selector
Relationship Selector
Pseudo-Class Selector
Attribute Selector
Pseudo-Object Selector
css1 and css2