首页 > 解决方案 > 为什么我没有在我的 div 中获得图像背景?

问题描述

mystyle1.css 中的以下内容在我家里的笔记本电脑上效果很好,我得到了一个带有星空背景的 div。

但是,当我将它上传到我的 GoDaddy 网页时,没有星空!

文件夹排列相同,在带有html文件的文件夹中是子文件夹css,images,mp3,php

谁能告诉我为什么这在家里有效,但在我的主机上无效?

#div-alien {
    width:90%;
    margin:0 auto;   
    /*temporary text styles below*/
    text-align:center;
    font-weight:bold;
    font-size: 25px;
    color: white;
    background-image: url("../images/starrysky1.jpeg");
    background-color: #cccccc;
    height: 500px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    border:3px; 
    border-style:solid; 
    border-color:#FF0000;

} 

标签: html

解决方案


推荐阅读