简体   繁体   English

无法检索背景图片CSS

[英]can't retrieve background image CSS

I am having problem with CSS retrieving the pictures to display, but it works on my first form which I use CSS, but the thing is when I created the second CSS and apply on different pages, my background images can't be display and I confirmed that my pictures locations are correct.May I know what kind of issues that might be causing this?? 我在CSS上检索要显示的图片时遇到问题,但是它可以在我使用CSS的第一种形式上工作,但是问题是当我创建第二种CSS并应用于不同的页面时,我的背景图像无法显示,我确认我的图片位置正确。我可以知道是什么原因引起的吗??

<head runat="server">
<link rel="stylesheet" href="studymain.css" type="text/css">
<title></title>
<style type="text/css">
    .style1
    {
        text-align: center;
    }
    .style2
    {
        font-size: 50pt;
    }
</style>
</link>

================================================ below are my studymain.css files =================================================我的studymain.css文件

body {
    background-repeat:no-repeat;
    background-position: center;
    background-attachment:absolute;
    width:100%;
    font-weight: 700;
    color: #C0C0C0;
    background-color: transparent;
    background-image: url('images/Login.jpg');
}

The problem will be in this line: url('images/Login.jpg'); 问题将在以下行中: url('images/Login.jpg'); . Your page is probably not where you think it is. 您的页面可能不在您认为的位置。

You can try one or more of these fixes: 您可以尝试以下一种或多种修复程序:

  • Adding a leading slash: url('/images/Login.jpg'); 添加一个斜杠: url('/images/Login.jpg'); which tells the server to start looking at the root directory 告诉服务器开始查看根目录
  • Adding a parent directory: url('../images/Login.jpg'); 添加父目录: url('../images/Login.jpg'); which tells the server to look above the current directory (can have more than one of these) 告诉服务器在当前目录上方查看(可以有多个目录)
  • If it's a Linux server, addresses are case-sensitive, so you may need to use login.jpg . 如果是Linux服务器,则地址区分大小写,因此您可能需要使用login.jpg
  • Make sure the image exists. 确保图像存在。
  • When you view the page source, most browsers will have a link to the image. 当您查看页面源代码时,大多数浏览器将具有指向该图像的链接。 Try clicking it to check if the browser can be directed to the image. 尝试单击它以检查浏览器是否可以定向到该图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM