Summary of various forms of applying CSS styles in web pages

Summary of various forms of applying CSS styles in web pages
1. Inline style, placed in <body></body>:

Copy code
The code is as follows:

<div style="style content; semicolon separated"> Inline style</div>

2. Internal styles are usually placed in the head, but can also be placed in the body, but it is recommended to be placed in the head

Copy code
The code is as follows:

<head>
<style type="text/css">
body{font-family:"Microsoft YaHei";}
</style>
</head>

3. External styles, usually placed in the head part;

Copy code
The code is as follows:

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

It can also be placed in the body, it is recommended to be placed in the head;

4. Import external style sheets. Older browsers may not support this method.

Copy code
The code is as follows:

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

<<:  CSS border half or partially visible implementation code

>>:  Docker container source code deployment httpd use storage volume to deploy the website (recommended)

Recommend

Example of how to create and run multiple MySQL containers in Docker

1. Use the mysql/mysql-server:latest image to qui...

MySQL foreign key setting method example

1. Foreign key setting method 1. In MySQL, in ord...

MySQL export of entire or single table data

Export a single table mysqldump -u user -p dbname...

Detailed introduction to JS basic concepts

Table of contents 1. Characteristics of JS 1.1 Mu...

js to achieve sliding carousel effect

This article shares the specific code of js to ac...

my.cnf (my.ini) important parameter optimization configuration instructions

MyISAM storage engine The MyISAM storage engine i...

Centos7 installation of FFmpeg audio/video tool simple document

ffmpeg is a very powerful audio and video process...

The easiest way to install MySQL 5.7.20 using yum in CentOS 7

The default database of CentOS7 is mariadb, but m...

How to deploy services in Windows Server 2016 (Graphic Tutorial)

introduction Sometimes, if there are a large numb...

How to use native JS to implement touch sliding monitoring events

Preface I wrote a small demo today. There is a pa...

Solution to the error when importing MySQL big data in Navicat

The data that Navicat has exported cannot be impo...

Share 12 commonly used Loaders in Webpack (Summary)

Table of contents Preface style-loader css-loader...