Home >Web Front-end >CSS Tutorial >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>
(Video tutorial recommendation: css video)
2. Internal style
Advantages: structural styles are separated
Disadvantages: incomplete separation
<style> div { color: violet; font-size: 16px; } </style>
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">
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!