Home > Web Front-end > CSS Tutorial > Comparison of the advantages and disadvantages of css style introduction methods

Comparison of the advantages and disadvantages of css style introduction methods

王林
Release: 2020-05-17 09:02:33
forward
2667 people have browsed it

Comparison of the advantages and disadvantages of css style introduction methods

1. Inline style

Advantages: easy to write, high weight

Disadvantage: failure to separate structural styles

<div style="width: 100px" height:100px></div>
Copy after login

(Video tutorial recommendation: css video)

2. Internal style

Advantages: structural styles are separated

Disadvantages: incomplete separation

    <style>
        div {
            color: violet;
            font-size: 16px;
        }
    </style>
Copy after login

3. External style

Advantages: Complete separation of structure and style

Disadvantages: Need to introduce

    <!-- 引入css初始化文件 -->
    <link rel="stylesheet" href="css/normalize.css" />
    <!-- 引入公共样式 -->
    <link rel="stylesheet" href="css/baes.css">
    <!-- 引入首页样式 -->
    <link rel="stylesheet" href="css/index.css">
Copy after login

Recommended tutorial: CSS entry basics Tutorial

The above is the detailed content of Comparison of the advantages and disadvantages of css style introduction methods. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template