Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Python赢得了';无法从CSS加载图像_Html_Python 3.x_Css - Fatal编程技术网

Html Python赢得了';无法从CSS加载图像

Html Python赢得了';无法从CSS加载图像,html,python-3.x,css,Html,Python 3.x,Css,对编码还不熟悉,但已经轻松地学习了python。最近已经进入页面开发的最后阶段,但是CSS中的图像没有通过python正确加载 PY代码 HTML代码(行引用css) 在chrome中运行HTML时,一切都很好,就我所知,CSS的其余部分都很好,当我通过python运行它时,图像现在没有加载。我已经包括了环境中图像的路径。我已将图像的位置更改为静态文件夹,并更改了目录以查找它们,同时使URL尽可能具体,但没有成功。感谢所有能帮忙的人 from flask import Flask, re

对编码还不熟悉,但已经轻松地学习了python。最近已经进入页面开发的最后阶段,但是CSS中的图像没有通过python正确加载

PY代码 HTML代码(行引用css) 在chrome中运行HTML时,一切都很好,就我所知,CSS的其余部分都很好,当我通过python运行它时,图像现在没有加载。我已经包括了环境中图像的路径。我已将图像的位置更改为静态文件夹,并更改了目录以查找它们,同时使URL尽可能具体,但没有成功。感谢所有能帮忙的人

    from flask import Flask, render_template


    app = Flask(__name__)


    @app.route('/')
    def home():
    return render_template ('Sign_up.HTML')


    if __name__ == '__main__':
    app.run(debug=True)
<link rel="stylesheet" type="text/css" href="static/style.css" />
    body
    {
        margin:0;
        padding:0;
        background-image: URL(C:/project/img/bkg.png) ;
        background-size:  100%;
        font-size: 16px;
        color: #274FA6;
        font-family:  sans-serif;
        font-weight: 300;
    }

    #login-box
    {
        position: relative;
        z-index: 2;
        margin: 5% auto;
        width:800px;
        right:2px;
        height: 500px;
        background-image: URL(C:/project/img/LoginBox.png);
        background-size: 100%;
        box-shadow: 0 2px 4px rgba(0,0,0.6);