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
The installation tutorial of mysql 8.0.20 winx64....
1. Download Python 3 wget https://www.python.org/...
This article shares the specific code of js to im...
Scenario: A laradock development environment (php...
There are four types of positioning in CSS, which...
Key Takeaways: 1. Mastering CSS3 3D animation 2. ...
1. Install and start nginx # Install nginx sudo a...
Rational ClearCase is a software configuration ma...
Introduction to Text Shadows In CSS , use the tex...
MySQL handles duplicate data Some MySQL tables ma...
After installing the latest version 8.0.11 of mys...
Table of contents 1. Overview 2. Parameters for c...
By default, PHP on CentOS 7 runs as apache or nob...
Since the entire application needs to be deployed...
There are many form elements. Here is a brief sum...