[英]Body background image not showing
body { background-image:url(../images/bg.jpg); }
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="test.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <link href="style/StyleSheet.css" rel="stylesheet" /> <title></title> </head> <body> <form id="form1" runat="server"> <div> </div> </form> </body> </html>
我將該頁面作為登錄頁面,並在樣式文件夾中創建了樣式表文件。 當我將CSS鏈接到HTML時,背景不會改變。
您的CSS文件不在該位置,或者圖像不在該位置。 打開瀏覽器檢查器,例如在Google Chrome中,按[F12]。 這應該向您顯示錯誤消息,即找不到CSS文件或圖像。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.