python - flask将引用外部css的link的问题
PHP中文网
PHP中文网 2017-04-17 17:36:08
0
1
326

报错:
GET http://127.0.0.1:5000/css/bootstrap.min.css 404 (NOT FOUND)

我的link写法
<link href="css/bootstrap.min.css" rel="stylesheet">
没有开服务器的时候页面是正常显示的,开了服务器它就在链接前面添加了http://127.0.0.1:5000/ 导致找不到

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
左手右手慢动作

There is something wrong with the problem description. I don’t understand why the page displays normally when the server is not turned on.

In addition, is your static resource path correct? For <link href="css/bootstrap.min.css" rel="stylesheet">这种链接,
自然是会映射到http://127.0.0.1:5000/css/bootstrap.min.css, if it is external css, you can use the complete url to reference it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template