What are the ways to introduce CSS?

How to import CSS

  • css has three style sheets
    • inline style sheet (inline style)
    • Internal style sheets (embedded)
    • External Style Sheets (Linked)

internal style sheet

  • Extract the CSS code and put it in the style tag
  • Theoretically style can be placed anywhere, but by default it is placed in the head

inline style sheet

  • Just add the attribute style directly to the tag
  • Code sample:
<p style="color: pink; "></p>
  • style is a label attribute, which can only control the current label

external style sheet

  • use more methods

  • Write a separate css page externally

  • Steps

    1. Create a new .css file
    2. Write what was written in the style tag before in the css file
    3. Write tags in the head of the HTML page  <link> to introduce this page
    <link rel="stylesheet" herf="css路径">

Guess you like

Origin blog.csdn.net/LQZ8888/article/details/107898735