Css2 using style sheets

### css style sheets - Cascading Style Sheets
1. Internal stylesheet
      1) Syntax CSS
  selectors {
    Attribute 1: Property Value;
    Attribute 2: Property Value;
  }
    width width
    height The height of
    the background color of background-color
    font color Color
    #fff white, black 000 #
  2) using the method of
    introducing style tags in the head, the writing style tags within the css style
2. Waibuyangshibiao - structure and separation performance (with development)
    .. 1) at the site css file folder css created file
    2) create an association - introduction of the head in the link tag
    <link the rel = "this stylesheet" type = "text / css" the href = "css / new_file.css" />
    the rel = "this stylesheet" create an association
3 ) .css file uppermost section of the code @charset "utf-8"; (distortion when there is an encoding format, a plus)
    and normal writing style to
3. inline styles - almost no
    ### priority stylesheet level - the principle of proximity
    inline style>Internal style sheets and external style sheet
    highest priority A, inline style sheets
    B, internal style sheet and an external style sheet written in order of priority and related higher priority level after the writing.
    C, Scope: Minimum inline styles scope, can only be applied to the current element, followed by the internal style sheet can be applied to the current HTML file, and finally an external style sheet can be applied to all linked HTML files.
### selector (selector) - selected elements in the page
(typically the case for the whole page to be used in the label) 1. Elemental selector
    div} {
2.id selector
    <div id = "id Name "> </ div>
    id name Uniqueness - iD number
    naming convention: the beginning of the English, can take numbers, _, - do not allow keyword
    usage: #id {name}
    outermost container has a large id name
3 group selector
    , a plurality of spaced elements
    , for example: # Box, div, # {Content}
4. class selector - from the class name to the element
    <div class = "wrap"> </ div>
    name rule : alphanumeric _, beginning with the letter, see the name EENOW
    a plurality of elements can have the class name, class name may be used a plurality of elements
    usage: .wrap {}
    the intermediate element a plurality of class names separated by spaces
    < div class = "class name class 1 class 2. 3"> </ div>
. 5.

    For example: .Wrap> div
6. descendant selectors
    space as a connector, front and rear containment relationship is
7. The universal selector
    matches all page elements (Generally speaking, each page will be cleared within and outside the margins) but then not so written, will be specific to the tag, say back
    * {
    margin: 0; / * margins * /
    padding: 0; / * padding * /
    }
8. pseudo class selector
(easy to remember the order: Love-hate) :
 Link access a state before
: after the access state visited
: hover the mouse into ***** key status
: active inactive state
### to select the right value of an
inline 1000
ID selector 100 weights
class selector weights are 10
elements The selector value is 1 weight

Guess you like

Origin www.cnblogs.com/cxf1214/p/11273063.html
Recommended