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

Detailed explanation of the sticky position attribute in CSS

When developing mobile apps, you often encounter ...

How to use Nginx proxy to surf the Internet

I usually use nginx as a reverse proxy for tomcat...

Vue's new partner TypeScript quick start practice record

Table of contents 1. Build using the official sca...

Let's deeply understand the event object in js

We know that the commonly used events in JS are: ...

Introduction to the role of HTML doctype

Document mode has the following two functions: 1. ...

Summary of Nginx load balancing methods

To understand load balancing, you must first unde...

ElementUI implements the el-form form reset function button

Table of contents Business scenario: Effect demon...

Detailed explanation of Mysql's method of optimizing order by statement

In this article, we will learn about the optimiza...

Implementation of textarea adaptive height solution in Vue

Table of contents Hidden Problems Solution to ada...

Uninstalling MySQL database under Linux

How to uninstall MySQL database under Linux? The ...

Five ways to implement inheritance in js

Borrowing Constructors The basic idea of ​​this t...