Contents of this chapter:
- CSS Definition
- Four introduction methods
- The order in which styles are applied
- * Universal element selector
- Tag Selector
- class class selector
- # ID selector
- , multi-element selector
- Descendant element selector
- > Child element selector
- Adjacent element selector
- [] attribute selector
- Pseudo-class selector
- Color attributes (color, transparent, opacity)
- Font attributes (font-style, font-weight, font-size, font-family, font)
- Text attributes (white-space, direction, text-align, line-height, vertical-align, text-indent, letter-spacing, word-spacing, text-transform, text-overflow, text-decoration, text- shadow, word-wrap)
- Background properties (background-color, background-image, background-position, background-repeat, background-attachment, background)
- List attributes (list-style-type, list-style-image, list-style-position, list-style)
- Border (border-style, border-color, border-width, border-radius, border, box-shadow)
- Box model (padding, margin)
- display
- visibility
- float float
- clip crop image
- overflow Set how to display the content when the content of the object exceeds its specified height and width
- position specifies the positioning type of the element (static, relative, absolute, fixed)
- z-index element stacking order
- outline border outline
- zoom zoom ratio
- cursor mouse type shape (Crosshair, Pointer, Move, text, wait, help...)
- transform, transition animation effects
What is CSS?
CSS is the abbreviation of Cascading Style Sheets, which is called cascading style sheets in Chinese.
Attributes and attribute values are separated by colons and terminated by a semicolon.
Four ways to introduce CSS:
1.Inline
Inline style is to set the CSS style in the style attribute of the tag.
<div style="..."></div>
Copy after login
2.Embedded
Embedded formation is the & lt; style & lt; & lt;/style & gt; label pair of & lt; style & lt;/style & gt;
<head>
...
<style type="text/css">
...此处写CSS样式
</style>
</head>
Copy after login
3.Import
Introduce an independent .css file into the HTML file. Import use @import to introduce external CSS files. The