First, a simple understanding of the browser and Web page interaction process
CSS style sheet (stylesheet)
Cascading style sheet cascading style sheet
Performance Computer language for HTML or XHTML file styles: Includes settings for font, color, margins, height, background picture, page positioning, and more
CSS Benefits: Separation of content from performance
Web page performance is unified, easy to modify
Rich styling to make the page layout more flexible
Reduce the amount of Web page code, increase the browsing speed of Web pages, save network bandwidth
using page-independent CSS facilitates web pages to be indexed by search engines
There are three ways to insert a CSS style sheet:
external style sheet (External style sheet)
The difference between a link and an import 1 <link rel= "stylesheet" type= "Text/css " href= "path"> <style type= "Text/css"> @import url (path); </style> <link/> tags are XHTML,@import belong to CSS2.1 use the <link/> linked CSS file to load into the Web page before compiling the display using the @import imported css file, the client displays the HTML structure and then the CSS file is loaded into the Web page @import is unique to CSS2.1 and is not valid for incompatible CSS2.1 browsers . |
Internal style sheet (Internal style sheet)
CSS code written in <style> tags <style> H1{color:green;} </style> Pros: Easy to modify styles on the same page Disadvantage: not conducive to the sharing of multiple pages between the code and maintenance, the separation of content and style is not complete. |
Inline styles (inline style)
using the style property to introduce CSS Styles application of >style attributes <p style= "Font-size:14px;color:green;" > Set the style directly in the HTML tag </p> |
CSS three types of Insert style table format