Python 使用烧瓶时,图片不会装入div

Python 使用烧瓶时,图片不会装入div,python,html,css,image,flask,Python,Html,Css,Image,Flask,我正在创建一个单页应用程序,但我的#mainPicture将不会加载到其假定的div中。这就是我在index.html中调用它的地方: <body> <div id="mainPicture"> <div class="picture"> <div id="headerTitle">Places I've Been</div> <div id="headerSubtext">A Bl

我正在创建一个单页应用程序,但我的#mainPicture将不会加载到其假定的div中。这就是我在index.html中调用它的地方:

<body>

<div id="mainPicture">
    <div class="picture">
        <div id="headerTitle">Places I've Been</div>
        <div id="headerSubtext">A Blog About My Travels</div>
    </div>
</div>
#mainPicture
{
    width:670px;
    height:497px;
    background-color:#FFFFFF;
}

#mainPicture.picture
{
    position:relative;
    width:650px;
    height:487px;
    top:10px;
    background-image:url(hudson1.jpg);
    background-repeat:no-repeat;
    margin-left:10px;
}
它只是显示为图片大小的空白。我正在使用CMDER运行我的网页。图像hudson1.jpg与theme.css也在同一文件夹中,但它不会显示在div中


任何帮助都很好。

您的选择器不正确

#mainPicture.picture
正在查找id为mainPicture和class picture的元素。你应使用:

#mainPicture > .picture

这将选择具有图片类的元素,该图片类是id为mainPicture的元素的子元素。

您的选择器不正确

#mainPicture.picture
正在查找id为mainPicture和class picture的元素。你应使用:

#mainPicture > .picture

这将选择具有图片类的元素,该图片类是id为mainPicture的元素的子元素。

是否
hudson1.jpg
theme.css
在同一文件夹中?如果没有,那就是你的问题。
hudson1.jpg
theme.css
是否在同一个文件夹中?如果不是,那就是你的问题。