Home > Article > Web Front-end > Detailed explanation of the differences between CSS basic style sheet classification and selector classification
1 . Style Sheet Cascading Style Sheet
css advantages:
Separation of content and performance
## The performance of the web page is unified and easy to modify
Rich The style makes the web page layout more flexible
Four types
## Inline style sheet
import method, try not to use it! ! !
1.2 Introduction methodPriority
Inline>Internal>External>Import 1.3
The difference between link type and import type:
The tag belongs to XHTML, @import belongs to CSS2.1;
Selector
# ID Selector
#Ahtml document can only have one ID
Class selection Container . Can have multiple ## elements p
##Wildcard *
2.2 Priority of selector
## ID > CLASS > Element > * 3 . Basic styles (commonly used for text, pictures, lists) colorColor color Specifies the color of the text ##opacity Sets the transparency of the element, 1 opaque 0 complete Transparent ##font font specifies the font style of the text (normal, italic) specifies whether the text For small uppercase letters (works for English) specifies the weight of the text ( has only two styles ) bold bold ## font Composite attribute General sequence: Font style, whether it is small caps, font thickness, font size, font text text attribute color, text-align, line-height letter-spacing, vertical-align, text-indent,text-decoration ;##-----[vertical-align----->1. Commonly used for text box input, 2. Combined with {display:table-cell;} can be used to center the image vertically】 -----[valign----->Only applicable to table Cell, for examplebackground背景
1.background-color 背景色 (16进制数 rgb rgba 英文名)
2.background-image 背景图
3.background-size 背景大小 (像素、百分比)
4.background-repeat (repeat-x repeat-y no-repeat)
5.background-position (通过方向值来指定,通过百分比指定,通过确切的像素值指定)
6.background-attachment 是否随着浏览器滚动,使用它图片会相对浏览器固定住(bg-position和bg-attachment不要一起使用)
7.background复合属性 可以把之前的属性定义在这一个里面,【一般书写顺序:颜色、图片、是否重复、是否固定、位置】
##----- 【align-----> Applicable to
, for example:
right" width
## The above is the detailed content of Detailed explanation of the differences between CSS basic style sheet classification and selector classification. For more information, please follow other related articles on the PHP Chinese website!, for example:
·· ····
;## , for example: The text is displayed relative to the top of the picture ; ##Related articles
See more