【发布时间】:2015-04-14 12:25:14
【问题描述】:
我正在 Visual Studios 中制作网站。我试图改变我网站的背景。当我在 Visual Studios 中添加图像时,它会发生变化,但是当我启动它以在 Web 浏览器中查看它时,背景图像就消失了。
'<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
width: 100%;
}
h1{
text-align:center;
font-family:Andalus;
color:white;
}
body{
background-image: url('C:\Users\........\Desktop\wood.jpg');
text-align:center;
}
.auto-style2 {
width: 664px;
}
p{
font-family:Cambria;
color:white;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1> Welcome</h1>
</div>
<table class="auto-style1">
<tr>
<td class="auto-style2"><p>Username</p></td>
<td class="auto-style2"><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
<td class="auto-style2"> </td>
<td>
</td>
</tr>
<tr>
<td class="auto-style2">
<p>Password</p></td>
<td class="auto-style2">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
<td class="auto-style2">
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style2">
</td>
<td class="auto-style2">
<asp:Button ID="Login" runat="server" OnClick="Login_Click" Text="Log in " />
</td>
<td class="auto-style2">
</td>
<td>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Log in as guest" />
</td>
</tr>
</table>
<asp:Label ID="Label1" runat="server"></asp:Label>
</form>
【问题讨论】:
-
查看图片在
background-image: url('C:\Users\........\Desktop\wood.jpg');中的路径 -
我在 Visual Studio 的预览窗口中仔细检查了它,它显示但不在浏览器中这是我第一次使用 Visual Studios
标签: html image visual-studio background