在asp.net中显示背景图片时出错 [英] error in displaying background image in asp.net

查看:86
本文介绍了在asp.net中显示背景图片时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net中创建了一个div,其中div,3个子div在那里.1st是一个标题div,第二个是whict中的内容div再次2个细分就在那里.3rd one是footer div。 ..i已完成以下编码..

 <  正文 >  
< 表格 id = form1 runat = 服务器 >
< div class = 容器 >
< < span class =code-leadattribute> div = 标题 > ;
< h1 样式 = text-align:center ; font-style:italic > 欢迎访问网站世界< / h1 >
< / div >
< div class = 菜单 >

< asp:菜单 < span class =code-attribute> ID = headermenu runat = server BackColor = #CC0099 ForeColor = #333399

方向 = 水平 EnableTheming = True IncludeStyleBlock = true

< span class =code-attribute> ClientIDMode = 静态 ViewStateMode = 已启用 高度 = 30px >
< Items >
< asp :MenuItem NavigateUrl = 文字 = HOME >
< / asp:MenuItem >
< asp:MenuItem NavigateU rl
= 文字 = 关于我们 / >
< asp:MenuItem NavigateUrl = 文字 = 联系我们 / >
< / Items >
< / asp:Menu >
< / div >
< div class = content >
< div class = content1 >
< span class =code-keyword>< >
< tr >
< td > NAME < / td >
< td style = float:right > < ; asp:TextBox ID = nametxt runat = server / < span class =code-keyword>> < / td >
< / tr < span class =code-keyword>>
< tr >
< td > AGE < / td >
< td style = float:right > < asp:TextBox ID = agetxt runat = server / > < / td >
< / tr < span class =code-keyword>>
< tr >
< td > ADDRESS < / td >
< td style = 浮动:右; display:block > < asp:TextBox ID = addresstxt runat = 服务器

< span class =code-attribute> < span class =code-attribute> TextMode = MultiLine > < / asp:TextBox > < / td >
< / tr >
< / table < span class =code-keyword>>
< / div >
< div class = content2 >
用户名:
< asp:TextBox ID = usernametxt runat = server / >
< br / > < br / > < br / > < br / >
PASSWORD:
< asp:TextBox ID = passwordtxt runat = server TextMode = 密码 / >
< br / > < < span class =code-leadattribute> br / > < br / > < br / >
< asp:按钮 ID = loginbtn runat = 服务器 文本 = 登录 宽度 = 100px / >
< / div >
< / div >
< / div >
< div class = footer style = background-color:Silver;文本对齐:中心;明确:两者;高度:50px > < br / > Copyright@footer.com
< / div >


< / form >
< / body >





,在样式表中,以下编码为完成..

  body  
{
background-color ActiveCaption;
}

header
{
background-image url(images / thCAUUWRRV.jpg);
height 100px;


}
。< span class =code-leadattribute> menu
{
height 50px;
width 1000px;
}
container
{

border 2px纯黑;
border-style double;
margin-left 50px;
margin-bottom 50px;
margin-right 50px;
margin-top < span class =code-keyword> auto;

}
content1
{

float left;
height 400px;
width 600px;
text-align center;
background-image url( images / 609094 [1] .jpg);

}
content2
{
background-image url(images / 599999 [1] .jpg);

float right;
height 400px;
width 600px;

}



现在的问题是背景图片是显示表格但在运行时没有显示..

请解决问题...

解决方案

试试这个...... :)



 header  
{
< span class =code-attribute> background-image url('images / thCAUUWRRV.jpg' );
height 100px;


}
content1
{

float left;
height 400px;
width 600px;
text-align center;
background-image url('images /609094 [1].jpg');

}
content2
{
background-image url('images / 599999 [1] .jpg');

float right;
height 400px;
width 600px;

}





和be确保使用图片网址。


< blockquote>确保您已连接到互联网,因为有时如果您没有连接到网络,则会导致问题。

正确检查您的网址


i create a div in asp.net..in that div,3 sub divs are there..1st one is header div,2nd one is content div in whict again 2 subdivs are there..3rd one is footer div...i have done the following coding..

<body>
 <form id="form1" runat="server">
    <div class="container">
           <div  class="header">
           <h1 style="text-align:center; font-style:italic">WELCOME TO THE WORLD OF WEBSITE</h1>
           </div>
           <div class="menu">

                 <asp:Menu ID="headermenu" runat="server" BackColor="#CC0099" ForeColor="#333399"

                     Orientation="Horizontal" EnableTheming="True" IncludeStyleBlock="true"

                     ClientIDMode="Static" ViewStateMode="Enabled" Height="30px">
                     <Items>
                     <asp:MenuItem NavigateUrl="" Text="HOME">
                     </asp:MenuItem>
                     <asp:MenuItem NavigateUrl="" Text="ABOUT US" />
                     <asp:MenuItem NavigateUrl="" Text="CONTACT US" />
                     </Items>
                 </asp:Menu>
           </div>
           <div class="content">
                 <div class="content1">
                     <table>
                     <tr>
                     <td>NAME</td>
                     <td style="float:right"><asp:TextBox ID="nametxt" runat="server" /></td>
                     </tr>
                     <tr>
                     <td>AGE</td>
                     <td style="float:right"><asp:TextBox ID="agetxt" runat="server" /></td>
                     </tr>
                     <tr>
                     <td>ADDRESS</td>
                     <td style="float:right; display:block"><asp:TextBox ID="addresstxt" runat="server"

                             TextMode="MultiLine"></asp:TextBox></td>
                     </tr>
                     </table>
                 </div>
                 <div class="content2">
                     USER NAME:
                     <asp:TextBox ID="usernametxt" runat="server" />
                     <br /><br /><br /><br />
                     PASSWORD:
                     <asp:TextBox ID="passwordtxt" runat="server" TextMode="Password" />
                     <br /><br /><br /><br />
                     <asp:Button ID="loginbtn" runat="server" Text="LOGIN" Width="100px" />
                 </div>
            </div>
      </div>
           <div class="footer" style="background-color:Silver; text-align:center; clear:both ; height:50px"><br />Copyright@footer.com
           </div>


  </form>
</body>



and in stylesheet form the following coding is done..

body
{
    background-color:ActiveCaption;
}

.header
{
    background-image:url("images/thCAUUWRRV.jpg");
    height:100px;


}
.menu
{
   height:50px;
   width:1000px;
}
.container
{

    border:2px solid black;
    border-style:double;
    margin-left:50px;
    margin-bottom:50px;
     margin-right:50px;
     margin-top:auto;

}
.content1
{

  float :left ;
  height:400px;
  width:600px;
  text-align:center;
  background-image:url("images/609094[1].jpg");

}
.content2
{
    background-image:url("images/599999[1].jpg");

    float:right;
    height:400px;
    width:600px;

    }


now the problem is that the background images are showing on the form but not displaying during run time..
please sort out the problem...

解决方案

try this...:)

.header
{
    background-image:url('images/thCAUUWRRV.jpg');
    height:100px;
 

}
.content1
{
 
  float :left ;
  height:400px;
  width:600px;
  text-align:center;
  background-image:url('images/609094[1].jpg');
 
}
.content2
{
    background-image:url('images/599999[1].jpg');
 
    float:right;
    height:400px;
    width:600px;
 
    }



and be sure with Image URL.


make sure you are connected to internet because sometimes if you are not connected to net it causes problem.
Check your URL properly


这篇关于在asp.net中显示背景图片时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆