css3 style sheet introduction-study notes 7

Inline style sheet (inline style)

The internal style sheet (embedded style sheet) is written inside the html page. It extracts all the CSS code and puts it in a single <style>tag.

<style> 
    div {
    
     
      color: red; 
      font-size: 12px; 
    } 
 </style> 

Internal style sheet (embedded)

Inline style sheet (inline style sheet) is to set the CSS style in the style attribute inside the element tag. Suitable for modifying simple styles.

<div style="color: red; font-size: 12px;">青春不常在,抓紧谈恋爱</div> 

External style sheet (linked)

This is the most commonly used, which completely realizes the separation of structural styles. There
are two steps to introduce external style sheets:

  • Create a new style file with a suffix of .css, and put all CSS codes into this file.
  • In the HTML page, use tags to import this file.
 <link rel="stylesheet"  href="css文件路径"> 

Insert picture description here

to sum up

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45019830/article/details/107582023