An external CSS style (also known as an inline) is to write the CSS code in a separate external file, with the CSS style file " .css
" as the extension, within
<link href="base.css" rel="stylesheet" type="text/css" />
Attention:
1. CSS style file names are named with meaningful English letters, such as MAIN.CSS.
2, rel= "stylesheet" type= "text/css" is fixed notation cannot be modified.
3, <link> label location is generally written in the
Example:
Style.css
span{ color:red; font-size:20px;}
Index.html
<!DOCTYPE HTML><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>Inline CSS Styles</title><Linkhref= "Style.css"rel= "stylesheet"type= "Text/css" /></Head><Body> <P>XX NET,<span>Super Cool Internet</span>, it technology free learning platform, innovative network one-stop learning, practical experience;<span>Prompt and attentive service</span>, Content Professional,<span>Fun and easy to learn</span>。 Focus on the service of Internet engineers quickly become a master of technology!</P></Body></HTML>
Effect:
External CSS style, written in a separate file