What are the basic properties of Css
This article is about what the basic attributes of Css are. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
I. tag attributes and styles
1. The content of the web page corresponds to the tag according to the function you want.
2. Find the corresponding tag, click on the box to see the prompt, and select the corresponding word (or style) to describe the tag.
Can directly type out we become attribute (attribute), similar to fonts in color and so on.
What can't be typed out is called detail, or rather, style Style.
Chongwei private land
TIPS: styles control the presentation of tags more accurately and more variously than attributes
2. CSS introduction:
Cascading [Kæ s'ke has a cascading style sheet] Style Sheet.
3. Selector:
1. Tag selector
Controls the corresponding tag through the keyword of the tag.
Test text
Abc
Def
/ * tag selector * /
Font {
Color:red
Font-size:20px
Font-family: Chinese Xingkai
}
TIPS: all corresponding tags will take effect, some of which do not want to take effect and need to be used
2. Class selector
Test text
Abc
Def
/ * Class selector, start with. Select a device name definition, and then use that definition to add class= "define class selector name" * / to the tag
.c1 {
Color:red
Font-size:20px
}
.c2 {
Color:blue
Font-size:30px
}
3. ID selector
Test text
Abc
Def
/ * ID selector, defined with the name of # selector, and the corresponding tag is called through ID * /
# c1 {
Color:green
Font-size:18px
}
TIPS: it is recommended that ID selectors should not be used repeatedly; try to reduce the definition and use of ID selectors to avoid code conflicts.
IV. Mode of use of CSS
1. Inline: find the corresponding tag and use style= to "describe".
2. Embedded: by sneaking into
3, outside the chain: first write the inline, and then the embedded style code is cut into a separate CSS file (named to be consistent with the corresponding foreground page), and the foreground page is deleted and written in.
TIPS:
1. In external files, you can @ charset "gbk"
5. CSS priority:
1. Attributes and styles, style first
2. In-line > in-line > outer chain
Thank you for reading! This is the end of this article on "what are the basic attributes of Css?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!