/***************************************css Precautions *******************************************/Browser Priority: Designer design style > Browser user custom style > browser self-setting stylein HTML code: Inline style > Inner style > External reference style/************************************************************************************************/<! DOCTYPE html>
<!--Direct link plus enter will be less than the Type property --<link rel= "stylesheet" type= "Text/css" href= "Css.css" ><!--in both CSS and MYCSS, the background color is set, but the reference order is different, which results in a different display effect--<link rel= "stylesheet" type= "Text/css" href= "Mycss.css" ><!--Although the color is displayed in Mycss, it overrides the background color of the CSS, but in CSS, the font size of the header is displayed, which is the CSS style cascade effect --<style type= "Text/css" > footer{background:rgb (179, 179);} </style><!--inline style has the highest precedence, although the background color of the header is set to RGB (MYCSS, 157, 185);<!--normal display of the background style in the MYCSS, but because the inner style is defined above, the RGB (179, 179) in the style is displayed;<!--If the CSS in the external reference link is placed below the <style> inner style, the background color in the MYCSS is still displayed -<footer> Bottom Style background </footer><!--****************************** Final summary ***************************** --<!--1, regardless of the display of that style, in the style display, mainly to display the most recent style from the content, a layer of coverage (nearest principle) --<!--2,! Important the highest priority, set in an external reference CSS style, or inside a style, plus!important, with precedence over inline style -<!--*************************************************************************** --</body>/******************************************* New File css.css**************************************************** ***/<[email protected] "UTF-8"; defines the type of the CSS character, if the writing must be at the end of the ";" otherwise it will result in a syntax error, or do not write, select the default--@charset "UTF-8"; header{background:red;font-size:30px;} Footer{background:blue;}/********************************************************************************************************** ************//********************************************* New File mycss.css************************************************ ***/@charset "UTF-8"; Header{background:rgb (64, 157, 185);} Footer{background:rgb (162, 162, 233);}/********************************************************************************************************** *************/
CSS Reference Precedence