你是怎么设置的CSS添加一个asp IMG? [英] how do you set css to add an asp img?

查看:162
本文介绍了你是怎么设置的CSS添加一个asp IMG?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你是怎么设置的CSS添加一个asp IMG?

我需要到div藏汉及其调整范围内控制图像的大小? preferably的权利,使其在div内规模的15%?

所有的这可能吗?

  DIV#{测试
宽度:90%;
的z-index:1;
填充:27.5px;
边境顶:细实#736F6E;
下边框:细实#736F6E;
颜色:#FFFFFF;
保证金:0汽车;
空格:pre;
空格:pre-包装;
空格:pre系列;
自动换行:打破字;
}


解决方案

机会是没有。

如果你的意思是图像服务器控件(或< ASP:图像> 或`)CSS是一种客户端技术,而任何Asp.NET服务器控件是服务器-侧。 (关键字:在服务器控件是服务器;))

如果你的意思是一个HTML图像(< IMG> 没有 =服务器)则没有再次。你会使用JavaScript来做到这一点:CSS不能添加的元素的(东西像&LT标签; IMG> )的文件。它可以使用内容属性添加文本上下文但不喜欢元素< IMG方式>

最后,如果你的意思是给的格的背景图像,是的,CSS可以做到这一点,使用背景图片属性...但我不认为你可以调整背景图像。也许用CSS3 ......我不知道。

how do you set css to add an asp img?

I need to control the size of the image within the div aswell and its alignment? Preferably to the right and make it 15% of the size inside the div?

Any of this possible?

div#test {
width:90%; 
z-index:1; 
padding:27.5px; 
border-top: thin solid #736F6E;
border-bottom: thin solid #736F6E;
color:#ffffff;
margin:0 auto;
white-space: pre;
white-space: pre-wrap;
white-space: pre-line;
word-wrap: break-word;
}

解决方案

Chances are no.

If you mean an image server control (either <asp:Image> or `) CSS is a client-side technology while any Asp.NET server controls are server-side. (keyword: in server controls is server ;) )

If you mean an HTML image (<img> with no runat="server") then no again. You'd use JavaScript to do this: CSS cannot add elements (things with tags like <img>) to the document. It can add text context using the content property but not elements like <img>.

Lastly, if you mean give "the div" a background image, yes, CSS can do this, using the background-image property... but I don't think you can resize background images. Maybe with CSS3... I'm not sure.

这篇关于你是怎么设置的CSS添加一个asp IMG?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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