2013-02-13 214 views
0

這是我的CSS: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

看看瀏覽器的開發人員工具的網絡選項卡。圖像加載是否正確? – JJJ 2013-02-13 07:40:48

+0

檢查您傳遞給圖片的網址是否正確。 – 2013-02-13 07:41:29

+0

此外,請顯示生成的HTML,而不是ASP代碼。 – JJJ 2013-02-13 07:41:48

回答

0

好現在的工作,似乎如Internet Explorer一直在尋找在錯誤的文件夾..必須somekind的OM Visual Studio中的bug /設置我diden't通知..