Record day learning css

Since his first time with this, I do not know, so I thought diaries and essays almost found the diary can not publish, so yesterday and released together on today, which is to give some adorable new advice.

Today, an hour of learning HTML, the rest are css (Cascading Style Sheets), here I put the teacher was talking about sorted out. I wrote that part is more difficult.

The use css ()
the line pattern 1 (inline styles)
<tag style = "attribute name 1: 1 attribute value; property name 2: attribute value 2; ..."> </ tab>
2. embedded in the page ( internal style sheet)
increase in the head tag inside a sub-tag
<style>
selector
attribute names 1: 1 attribute value;
property name 2: attribute value 2;



3. external files (external style sheet)
in the head tag, add an subtag
<link rel = "stylesheet" hreffile path css" />
4. external introducing pattern
mainly in style initialization. Because there are some labels have their own style, we need to be emptied to facilitate their computing


css syntax: (Symbols are in English)
selector {
property name 1: attribute value 1;
attribute name 2: attribute value 2;

css ------ selector
ID selector
using the selector id: id add an attribute in the elements above, the id attribute value of the attribute not start with a number of
a page can only have an id attribute value
represents the css id selected the method is represented by #
class selector
using the class selectors: a class attribute increased on an element, an attribute value of the class attribute does not start with a number
a page can have multiple class attribute value
. css representation by the representation of the class selector
the tag selector
to write directly to the tab name
combination selector
selector directly, can be separated
progeny selector
> only for progeny
descendant selectors
with spaces, said progeny contains the selectors
universal selector: for all the label

Note :

(The right to choose is heavy
inline style 1000
the above mentioned id 100
elements 1
class 10
common 0
BOSS! Important long appeared, mainly to the


higher the weight, style, part of the conflict on to the high weight of the main, not to say this the selector is not used, but which conflicts style
heavy weights just only as a reference

to calculate the weight
does not require the tube and progeny
If the weights are the same, the principle of proximity. whichever is later defined)

 

 

 

Guess you like

Origin www.cnblogs.com/susucom/p/10939241.html