图片在浏览器窗口中不可见 [英] Image not visible in browser window

查看:62
本文介绍了图片在浏览器窗口中不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我已经在.cs文件中编写了以下代码:

Dear All,

I have written the following code in .cs file:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link href="Stylesheets/OEIS_v1.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div id="HeaderGraphic"></div>
        <div id="NavigationArea">| link1 | link2 | link3 | link3 |</div>
        <div id="BodyArea">
            <div id="BodyLeft">Left Text</div>
            <div id="BodyRight">Right Text</div>
        </div>
        <div id="FooterArea">© 2011 - 2012: SSB</div>
    </div>
    </form>
</body>
</html>



我已将.css文件创建为:



I have created the .css file as:

body
{
    padding-right: 1%;
    padding-left: 1%;
    padding-bottom: 1%;
    margin: 0%;
    padding-top: 1%;
    height: 98%;
    background-color: #f8fec8;
    text-align: center;
}
#HeaderGraphic
{
    background-image: url(Images/HeaderImg.JPG);
    width: 697px;
    height: 152px;
    float: none;
    clear: both;
}



现在,当我执行应用程序时,尽管有太多空间显示为空白,但我看不到图像.

任何人都可以提出一个原因及其解决方案.

提前谢谢您.

问候,
Indrajeet



Now when I am executing the application I cannot see the image though that much space is shown blank.

Can anyone suggest a reason and its resolution.

Thanking you in advance.

regards,
Indrajeet

推荐答案

不能确定,但​​可以尝试类似的操作(取决于images文件夹的相对位置):

Can''t be certain but try something like (depending on the relative location of the images folder):

background-image: url('../Images/HeaderImg.JPG');


尝试
background-image: url('/Images/HeaderImg.JPG');






or


background-image: url('../Images/HeaderImg.JPG');






将图片放在根目录中,然后




or

put image in root directory and

background-image: url('HeaderImg.JPG');


这篇关于图片在浏览器窗口中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆