current position:Home>The fifth day of HTML + CSS surprise learning (5 / 12 days)

The fifth day of HTML + CSS surprise learning (5 / 12 days)

2022-01-27 01:21:23 BradKong

3、 ... and 、CSS grammar

1.CSS Introduction mode

(1) embedded :

Written in style In the label (CSS Must be in head in );

(2) Extraneous ( Chain in type ):

Write in a separate CSS file , recycling link Tags introduced CSS style ;

(3) Inline :

On the label style Properties of the ( Will cooperate with js Use , No, don't worry ).

2. Selectors :

(1) tag chooser :

Format : Tag name :{css Property name : Property value ;}

(2) Class selectors :

Format :. Class name :{css Property name : Property value ;}

( Class definition : tag class=” Class name “)

(3)id Selectors :

Format :#id Property value :{css Property name : Property value ;}

( Mostly used to cooperate with js Use , Only one label can be used )

(4) Wildcard selector :

Format :*{css Property name : Property value ;}

( Usually clear the default style , The actual application is less )

attach : Clear the default style code

*{
  margin:0;
  padding:0;
}

3. Font style :

(1) font size :font-size:XXpx( The attribute value is a number with pixel units )( The general default size is 16px);

(2) The font size :font-weight:XX( There are two font settings ; Keyword settings , Normal as normal, Bold as boid; Digital settings , take 100~900 The whole hundred of , Generally normal 400, Bold as 700);

(3) Font style ( Is it inclined ):font-style:normal( normal )/italic( tilt );

(4) Font selection :font-family:XXX( typeface );

( attach : Fonts fall into three categories : Sans serif fonts 、 Serif font 、 Equal width font )

(5) Layering : stay css Setting up , The following provisions cover the previous ;

(6)font Compound attribute :font: size thickness Is it inclined Select the font ;( Attribute values are separated by blank numbers ).

copyright notice
author[BradKong],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270121199484.html

Random recommended