The solution for php css not loading: first open the HTML document; then find the link tag that introduces the css file in the head tag; finally add "__STATIC__" in front of the value of the href attribute of the link tag.
The operating environment of this article: windows7 system, PHP7.1&&css3 version, DELL G3 computer
css in php is not loaded?
Solution:
First open the HTML document;
Then find the link tag that introduces the css file in the head tag;
Finally in Just add __STATIC__ in front of the value of the href attribute of the link tag.
<html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="__STATIC__/bs/css/bootstrap.min.css"> <script src="__STATIC__/bs/js/jquery.min.js"></script> <script src="__STATIC__/bs/js/bootstrap.min.js"></script> <title>Document</title> </head> <body> </body> </html>
View the source code in the browser:
<!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="[/tp5/public/static/bs/css/bootstrap.min.css] (http://localhost/tp5/public/static/bs/css/bootstrap.min.css)"> <script src="[/tp5/public/static//bs/js/jquery.min.js] (http://localhost/tp5/public/static//bs/js/jquery.min.js)"></script> <script src="[/tp5/public/static//bs/js/bootstrap.min.js] (http://localhost/tp5/public/static//bs/js/bootstrap.min.js)"></script> <title>Document</title> </head> <body> </body> </html>
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What to do if php css does not load. For more information, please follow other related articles on the PHP Chinese website!