Home > Web Front-end > Front-end Q&A > Reasons why CSS files externally referenced by HTML do not take effect

Reasons why CSS files externally referenced by HTML do not take effect

藏色散人
Release: 2022-12-30 11:11:48
Original
7889 people have browsed it

The reasons why the HTML external reference CSS file does not take effect: 1. There is no associated external CSS style sheet file or the associated path is wrong; 2. The encoding of the style sheet saved is wrong. You can save the css file in utf-8 encoding. Just click the file.

Reasons why CSS files externally referenced by HTML do not take effect

The operating environment of this tutorial: windows7 system, HTML5&&CSS3 version, Dell G3 computer.

Recommended: css video tutorial

The reasons why HTML external reference CSS files do not take effect

1. External CSS is not associated There is an error in the style sheet file or associated path

This is an error that makes people speechless, but I have encountered it before. After working hard to write the code, I found that none of the styles took effect, and I was busy working stupidly. After a long time, I finally found that I forgot to associate the external style or the path was wrong. My mood at that time was really. .

If all your styles do not take effect, first confirm whether the style sheet is associated, or whether the position and name of the associated style are correct

<link rel="stylesheet" href="css/index.css"/>
Copy after login

2. The encoding of the style sheet saved is wrong

If you suspect that the encoding of the CSS table is wrong, you can directly save the css file as a file in utf-8 encoding.

The above is the detailed content of Reasons why CSS files externally referenced by HTML do not take effect. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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