If your CSS is correct and there are no errors in the links, why doesn’t the CSS style take effect? You may be struggling with this matter, haha, don't be discouraged, I have been troubled by this matter before. At this time, you need to check whether there is the following sentence at the top of your webpage?
Some friends may say that I removed it after creating a new web page in the past, and it is useless. Now I want to tell you that this approach is wrong! So, what does this sentence mean and what effect does it have?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<!DOCTYPE html PUBLIC " -//W3C//DTD XHTML 1.0 Strict//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">
<!DOCTYPE html PUBLIC "-//W3C// DTD XHTML 1.0 Frameset//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-Frameset.dtd ">
I won’t go into too much nonsense. I don’t understand the concept or terminology. Let’s just talk about its function!
You can take a closer look at the differences between the three lines of code above. They represent three different XHTML document types.
Transitional type: refers to a transitional type. With this type of browser, the parsing of XHTML is relatively loose, and tags in HTML4.01 are allowed to be used, but they must comply with the syntax of XHTML. This is a common method now, and it is this type by default when creating a web page with Dreamweaver.
Strict type: Strict type. When used, the browser will be relatively strict and does not allow the use of any expressive form of identification and attributes, such as directly using the bgcolor background color attribute in the element.
Frameset type: Frame page type. If the web page uses a frame structure, it is necessary to use such a document declaration.
Now that the basic information is introduced, now you know why CSS doesn’t take effect. Don’t read this sentence, don’t ignore it!