css Full name: cascading style sheet , It is mainly used to define HTML Display style of content in browser , As text size , colour , Bold font, etc .
css Code is usually stored in style In label
css Styles consist of selectors and declarations , Declaration consists of attributes and values
Selector { attribute : value }, for example :p{color:red;};
Selector : Also known as selector , Indicates the elements in the web page to which style rules are applied
statement : In English braces {} In is the statement , Colon between property and value : separate . When there are multiple declarations , Semicolon in English ; separate .
css Placement position
Inline style
Direct label style Attribute
Not recommended
Inline Style Sheet
Written in style In label
External style sheet
Put an independent .css File import to HTML In file , use link The label is written in head In label .
rel="stylesheet" Define type as cascading style sheet
css Inheritance of
css Some styles of are inherited , So what is inheritance ? Inheritance is a rule , It allows styles to be applied to more than one specific html Label element , And it's applied to their offspring .
Non inheritable style :display,margin,border,padding,background,height,
minheight,max-height,width,min-width,max-width,
overflow,position,left,right,top,bottom,z-index,float,clear
Inheritable styles :letter-spacing,word-spacing,white-space,line-height
color,font,font-family,font-size,font-style,font-variant,
font-weight,text-decoration,text-transform,direction,visibility,cursor
Technology
Daily Recommendation