图像未显示在母版页表格中列的背景处?

发布于 2024-10-16 20:52:39 字数 1540 浏览 2 评论 0原文

   <%@ 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清风不识月 2024-10-23 20:52:39

尝试这样:

<td style="background-color:Black; background-image:url('<%= ResolveUrl("~/Images/Bluehills.jpg") %>');"  class="style1">
</td>

并确保 /Images/Bluehills.jpg 图像确实存在(我看到在您的 标记中您使用了不同的图像名称,名称中带有空格,位于 Image 文件夹中,而不是 Images)。

另请确保定义 的高度和宽度,否则图像可能无法显示:

<td style="background-color:Black; width: 100px; height: 100px; background:url('<%= ResolveUrl("~/Images/Bluehills.jpg") %>') no-repeat;" class="style1">
</td>

我还强烈建议您使用 FireBug 检查已加载的图像以及未加载的图像查看原因。它是一个优秀的工具,是每个 Web 开发人员的必备工具。

Try like this:

<td style="background-color:Black; background-image:url('<%= ResolveUrl("~/Images/Bluehills.jpg") %>');"  class="style1">
</td>

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 the Image folder instead of Images).

Also make sure that you define some height and width of the <td> or the image might not display:

<td style="background-color:Black; width: 100px; height: 100px; background:url('<%= ResolveUrl("~/Images/Bluehills.jpg") %>') no-repeat;" class="style1">
</td>

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.

街角卖回忆 2024-10-23 20:52:39

发现一个奇怪的但要显示的图像

这是解决方案,我使用它时没有波浪号,它工作不知道为什么,如果你知道请帮助我理解

小行代码是

<td style="background-image:url(Image/Bluehills.jpg);"  class="style1">
oiyhoyhobhobjho
jgkifjklhjljh
hghdoyjofjohjypt
dhgijrlyjhoftjpohktpu

</td>

通过使用此图像显示

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

<td style="background-image:url(Image/Bluehills.jpg);"  class="style1">
oiyhoyhobhobjho
jgkifjklhjljh
hghdoyjofjohjypt
dhgijrlyjhoftjpohktpu

</td>

By using this image get displayed

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文