Home > Web Front-end > HTML Tutorial > A brief talk about CSS, definitely what you want

A brief talk about CSS, definitely what you want

WBOY
Release: 2016-07-06 13:28:24
Original
1128 people have browsed it

Contents of this chapter:

  • Introduction
    1. CSS Definition
    2. Four introduction methods
    3. The order in which styles are applied
  • Selector
    1. * Universal element selector
    2. Tag Selector
    3. class class selector
    4. # ID selector
    5. , multi-element selector
    6. Descendant element selector
    7. > Child element selector
    8. Adjacent element selector
    9. [] attribute selector
    10. Pseudo-class selector
  • Common attributes
    1. Color attributes (color, transparent, opacity)
    2. Font attributes (font-style, font-weight, font-size, font-family, font)
    3. 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)
    4. Background properties (background-color, background-image, background-position, background-repeat, background-attachment, background)
    5. List attributes (list-style-type, list-style-image, list-style-position, list-style)
  • Page layout
    1. Border (border-style, border-color, border-width, border-radius, border, box-shadow)
    2. Box model (padding, margin)
    3. display
    4. visibility
    5. float float
    6. clip crop image
    7. overflow Set how to display the content when the content of the object exceeds its specified height and width
    8. position specifies the positioning type of the element (static, relative, absolute, fixed)
    9. z-index element stacking order
    10. outline border outline
    11. zoom zoom ratio
    12. cursor mouse type shape (Crosshair, Pointer, Move, text, wait, help...)
    13. 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