图像未显示在母版页表格中列的背景处?
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!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>
<style type="text/css">
.style1
{
width: 50px;
height: 323px;
}
.style2
{
width: 650px;
height: 323px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td style="width:30px; height:20px;">
<img src="Image/Blue%20hills.jpg"
style="height: 83px; width: 734px;" />
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td style="background-color:Black; background-image:url('~/Images/Bluehills.jpg');" class="style1">
</td>
<td class="style2">
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
reserved © softech infoways
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!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>
<style type="text/css">
.style1
{
width: 50px;
height: 323px;
}
.style2
{
width: 650px;
height: 323px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td style="width:30px; height:20px;">
<img src="Image/Blue%20hills.jpg"
style="height: 83px; width: 734px;" />
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td style="background-color:Black; background-image:url('~/Images/Bluehills.jpg');" class="style1">
</td>
<td class="style2">
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
reserved © softech infoways
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试这样:
并确保
/Images/Bluehills.jpg
图像确实存在(我看到在您的标记中您使用了不同的图像名称,名称中带有空格,位于
Image
文件夹中,而不是Images
)。另请确保定义
的高度和宽度,否则图像可能无法显示:
我还强烈建议您使用 FireBug 检查已加载的图像以及未加载的图像查看原因。它是一个优秀的工具,是每个 Web 开发人员的必备工具。
Try like this:
and make sure that the
/Images/Bluehills.jpg
image actually exists (I see that in your<img>
tag you are using a different image name, one with a space in its name and located in theImage
folder instead ofImages
).Also make sure that you define some height and width of the
<td>
or the image might not display:I would also strongly recommend you using FireBug to inspect what images are loaded and for those that are not loaded see the reason. It is an excellent tool and a must-have for every web developer.
发现一个奇怪的但要显示的图像
这是解决方案,我使用它时没有波浪号,它工作不知道为什么,如果你知道请帮助我理解
小行代码是
通过使用此图像显示
Found a strange but got the image to display
Here is solution i used it without tilde sign and it work don't know why please if u know help me to understand
Small line Code is
By using this image get displayed