CSS - 没有显示背景图像

时间:2013-02-13 07:36:52

标签: css html5

这是我的CSS:

body {

text-align:center;
vertical-align:central;
width:480px;
height:800px;
}

#content {
width:100px;
height:200px;
background-image:url("../App_GlobalResources/TopBanner.png");
display:inline-block;
}

我的HTML(母版页):

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Mobile.master.cs" Inherits="m.mysite" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>TestTitle</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<div id="header">
    test1234
</div>
<form id="form1" runat="server">
<div id="content">
    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
    </asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>

我有一个使用我的母版页的Default.aspx网站,但它很简单,不会显示我的图片..

如果我在html中制作一个img scr标签它显示正常..所以路径是正确的..还有什么呢? “ 这是输出HTML:

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
TestTitle
</title>
<link href="App_Themes/MobileTheme/MobileLayout.css" type="text/css" rel="stylesheet" />    </head>
<body>
<div id="header">
    test1234
</div>
<form method="post" action="" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTY1NDU2MTA1MmRkNWnHplPoHce7cSIeDENrnMaUn20Ibq7H6yKbaedCCPw=" />
</div>

<div id="content">

test

</div>
</form>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

好吧它现在有效,似乎Internet Explorer正在查找错误的文件夹..必须是某些东西Visual Studio bug /设置我不会注意到..