我想要每个图像背后的背景图像 [英] i want background image behind each image
本文介绍了我想要每个图像背后的背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在动态生成的每张图片后面应用背景图片。
请帮帮我。
i want to apply background image behind each images which is generated dynamically.
please help me.
for (int i = 0; i < s.Length; i++)
{
image1 += @" <a href='../Upload/Testimonial/" + s[i] + "' target='_blank' rel='prettyPhoto'><div style='width:100px; height:100px; padding:4px; background-image: url(../images/burnt.jpg);'><img runat='server' width='85px' height='80px' id='" + s[i] + "' src='../Upload/Testimonial/" + s[i] + "' /></a></div>";
}
image += @"<div class='gallery clearfix' style='float:left; width:100%;margin:15px 10px 10px 10px' clear='both'><div style='width:90%; margin:10px;padding:8px;background:#E5E4E2;border-radius: 9px;'><h3>" + Convert.ToString(ds1.Tables[0].Rows[co]["Author"]) + "</b></h3><br/>" + Convert.ToString(ds1.Tables[0].Rows[co]["Descr"]) + "</div><div class='gallery clearfix' style='width:100%; background-image: url(../images/burnt.jpg); height:100px; padding:8px; border-bottom:2px dashed #19354B;'>" + image1 + "</div></div><br/>";
image1 = "";
推荐答案
<img class="backgroundclass" />
和css
and in css
.backgroundclass
{
background-image:url(path to image);
// you can also add extra attributes to adjust then image of background
}
这将解决您的问题
:)
[更新]
this will sortout your issue
:)
[updated]
<pre lang="CSS">
.backgroundclass
{
background-image:url(path to image);
height:200px;
width:200px;
// you can also add extra attributes to adjust then image of background
}</pre>
这篇关于我想要每个图像背后的背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文