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

Analysis of MySQL multi-table joint query operation examples

This article describes the MySQL multi-table join...

Detailed explanation of the seven data types in JavaScript

Table of contents Preface: Detailed introduction:...

Use of MySQL DATE_FORMAT function

Suppose Taobao encourages people to shop during D...

Detailed steps for installing JDK and Tomcat on Linux cloud server (recommended)

Download and install JDK Step 1: First download t...

Install mysql5.7.17 using RPM under Linux

The installation method of MySQL5.7 rpm under Lin...

Linux yum package management method

Introduction yum (Yellow dog Updater, Modified) i...

MySQL stored procedures and common function code analysis

The concept of mysql stored procedure: A set of S...

Introduction to basic concepts and technologies used in Web development

Today, this article introduces some basic concept...

How many pixels should a web page be designed in?

Many web designers are confused about the width of...

Vue integrates a rich text editor that supports image zooming and dragging

need: According to business requirements, it is n...

Text mode in IE! Introduction to the role of DOCTYPE

After solving the form auto-fill problem discussed...

js drag and drop table to realize content calculation

This article example shares the specific code of ...

MYSQL subquery and nested query optimization example analysis

Check the top 100 highest scores in game history ...

Nginx reverse proxy forwards port 80 requests to 8080

Let's first understand a wave of concepts, wh...