Summary of four ways to introduce CSS (sharing)

Summary of four ways to introduce CSS (sharing)

1. Inline reference: used directly on the label, but the maintenance cost is high

style='font-size:16px;color:#000000'

2. External link reference: CSS code is separated from HTML code, which is convenient for code reuse

<link href="css/style.css" type="text/css" rel="stylesheet" />

The content of the style.css file is as follows:

.font{color:blue;font-size:12px;}

3. Internal reference: The page is clearer, but cannot be used by other pages

<style type='text/css'>
    .font{color:blue;font-size:12px;}
</style>

4. External import: You can import multiple style sheets in one HTML file. Similar to external link reference

Add this to the head tag in the HTML file

<style type='text/css'>
    @import url('./style/style.css');
</style>

The above summary (sharing) of four ways to introduce CSS is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

<<:  Detailed explanation of Json format

>>:  Implementation of waterfall layout in uni-app project

Recommend

JS+Canvas realizes dynamic clock effect

A dynamic clock demo based on Canvas is provided ...

A brief comparison of Props in React

Table of contents Props comparison of class compo...

Detailed explanation of the calculation method of flex-grow and flex-shrink in flex layout

Flex(彈性布局) in CSS can flexibly control the layout...

MySQL high concurrency method to generate unique order number

Preface After this blog post was published, some ...

Detailed explanation of COLLATION examples in MySQL that you may have overlooked

Preface The string types of MySQL database are CH...

Several commonly used single-page application website sharing

CSS3Please Take a look at this website yourself, ...

A Preliminary Study on JSBridge in Javascript

Table of contents The origin of JSBridge The bidi...

Share some tips on using JavaScript operators

Table of contents 1. Optional chaining operator [...

VMware virtual machine three connection methods example analysis

NAT In this way, the virtual machine's networ...

JavaScript realizes the drag effect of modal box

Here is a case of modal box dragging. The functio...

Mysql string interception and obtaining data in the specified string

Preface: I encountered a requirement to extract s...