this.LblImg.Text += "<li style='background:url(Image/BG7.jpg);' border='0'  width='246' height='335'>" + ds.Tables[0].Rows[i]["title"] + "</li>";我的本意是想 让“bg7。jpg”做“title”的背景  图片可以显示出来 但是大小的属性却用不上  大神 求科普!!!样式  C#

解决方案 »

  1.   

    http://www.php100.com/manual/css3_0/background-size.shtml
      

  2.   

    this.LblImg.Text += "<div style='background:url(Image/BG7.jpg);' border='0'  width='246' height='335'>" + ds.Tables[0].Rows[i]["title"] + "</div>";
      

  3.   

    "<div style=\"background:url(Image/BG7.jpg) ;border=0 ; width=246; height=335\">" 
      

  4.   

    "<div style='background:url(Image/BG7.jpg);' border='0'  width='246' height='335'></div>";
    这代码直接在网页里测试是没问题的
      

  5.   

     <div style='background:url(Image/BG7.jpg); margin-bottom: 0px; height: 100px; width: 891px;'></div>