href is a relative path and STATIC can be connected to solve the problem
static can also be used to define static variables and late static binding.
Since PHP 5.3.0, PHP has added a feature called late static binding, which is used to reference statically called classes in the inheritance scope.
The working principle of late static binding is to store the class name in the previous "non-forwarding call" (non-forwarding call). When making a static method call, the class name is the one explicitly specified (usually on the left part of the :: operator); when making a non-static method call, it is the class to which the object belongs.
<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 source code in browser:
|| | | | | | | | | | | | | | | | | | | | | | | | | | |
Recommended: php server
The above is the detailed content of How to solve the problem that php web page cannot use css and js. For more information, please follow other related articles on the PHP Chinese website!