Day05
02CSS
The relationship between Html,css and JavaScript
HTML is the carrier of Web content
CSS style is presentation (appearance control)
JavaScript is the behavior used to achieve the effects of Web page effects
CSS Cascading style sheet (cascading style Sheets)
Used to define HTML content and display styles within the browser
Why learn CSS
CSS simplifies HTML-related tag code, small page size, download fast
Solve the problem of separating content from performance
Better maintain web pages and improve productivity
CSS Basic syntax
How to use CSS
CSS Selector
CSS inheritance and cascading
CSS Precedence
CSS Naming conventions
CSS style rules
CSS rules consist of two parts: selectors, declaring
CSS References
Written in the <style type= "Text/css" >
CSS Styles
</style>
CSS comments/* Comment Contents */
Referencing CSS Styles
inline style (inline style)
<p style= "color:red;" > Content </p>
Internal style sheet (inline style)
<style type= "Text/css" >
Style
</style>
External style sheet, write CSS style code in a separate file extension: CSS file name. css
Introduction of external files: <link href= "Xx.css" rel= "stylesheet" type= "Text/css"/>
Import type
@import "css.css" or URL (css.css)
CSS use method precedence
Highest in-line priority
Inline style > Inner style > External style
Description
1. Linking to an external style the precedence between the internal style sheets depends on the order in which they are located
2. Final definition of highest priority (nearest principle)
Css_use1.html:
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>CSS use method precedence</title> <Linkrel= "stylesheet"type= "Text/css"href= "Css2.css"><!--Color:gray - <styletype= "Text/css">@import URL (css1.css); P{ /*Color:blue;*/ } </style> <Linkrel= "stylesheet"type= "Text/css"href= "Css3.css"><!--Color:orange -</Head><Body> <Pstyle= "color:red;"><b>How to use CSS</b></P></Body></HTML>
Icon:
02CSS3 Basic Syntax 05