When we write pages, we sometimes find that the CSS styles we write do not take effect. There are many reasons for this phenomenon. Here are some common reasons that I hope can help you. You are welcome to add to the comments section. Browser Cache Issues If you have checked and rechecked your code and think it is ok, then it may be a browser cache issue. Before troubleshooting, try clearing the browser cache, restarting the browser, or changing the browser. If that doesn't work, perform further troubleshooting. It is possible that you have done nothing wrong, and the problem is just caused by cache or browser. Resetting it may solve the problem. Use the browser's 'F12' element audit to see which styles are not being applied. Details The attribute name is incorrectly written so that it cannot match the HTML, or the attribute value does not conform to the specification; The HTML tags are not written completely, such as missing "<" or ">"; There is no semicolon in the middle of the css style; Style sheet association issues If your style is completely ineffective, first confirm whether the style sheet is associated, or whether the associated style location and name are correct; <link rel="stylesheet" type="text/css" href="mycss.css"/> Check whether the custom CSS style introduction tag is placed after the bootstrap framework style reference to ensure that it will not be overwritten by the framework style when the page is loaded. <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/> <link rel="stylesheet" type="text/css" href="mycss.css"/> Selector Problem Descendant selection, etc., involves multiple tags, class names, ids, etc., and the order and names of child selectors are written incorrectly, which may lead to errors; If you forget to write the class name and id in the html tag, and the selector uses these omitted class names, ids, etc., the style will naturally not take effect. The descendant selector forgot to add spaces; Check if there are any extra spaces, for example, whether the selector such as Encoding format problem Save all CSS and HTML web page files in UTF-8 format; that is, add Style cascading issues
Check order: This is the end of this article about CSS styles not working (the most comprehensive summary of solutions in history). For more related content about CSS styles not working, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! |
<<: Detailed explanation of the mysql database LIKE operator in python
>>: The use of vue directive v-bind and points to note
<br /> The website access speed can directly...
1. Table structure 2. Table data 3. The query tea...
Table of contents $nextTick() $forceUpdate() $set...
I reinstalled the computer and installed the late...
I recently came into contact with MySQL. Yesterda...
I have summarized 3 methods to deploy multiple fr...
Table of contents 1. Introduction 2. Main text 2....
Preface In our daily work, we often need to renam...
1. High degree of collapse In the document flow, ...
Preface It is said that if the people doing opera...
I have used the vi editor for several years, but ...
I've been using Bootstrap to develop a websit...
MYSQL version: MySQL Community Server 5.7.17, ins...
Unfortunately, the MYSQL_DATA_TRUNCATED error occ...
In new projects, axios can prevent duplicate subm...