图片是否在表格内的标签中调整大小? [英] Image resizing in tag inside table?
本文介绍了图片是否在表格内的标签中调整大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使小图片适合标签内的标签,但图像始终以实际像素为单位.任何想法如何调整内部图像的大小
i am trying to make a pic of small size fit to the tag inside tag but the image is always is in actual pixels. any idea how to do resizing of image inside
<table><tbody><tr><td></td></tr></tbody></table>
标签.
tag.
<table width="100%">
<tr>
<td height="90%" width="50%">
style="background-image: removed(''Album.jpg''); background-repeat: no-repeat;">
nbsp;
</td>
<td width="50%">
nbsp;
</td>
</tr>
</table>
推荐答案
图像调整大小与图像显示尺寸不同.希望您问的是如何以自定义尺寸显示图像.标记示例为
(以HTML格式显示)
<img id="MainContent_Image1" src="Test.jpg" style="height:50px;width:50px;" />
如果是网络服务器控件,则标记为
<asp:Image ID="Image1" ImageUrl="~/Test.jpg" Width="50" Height="50" runat="server" />
可以显示50 x 50像素的图像
我了解到您希望将图像作为背景.您可以做的是调整图像的大小,如上所示.将位置设为绝对位置,然后将其恰好放置在标签上方.然后将其z-index设置为-1000,因此它就像背景一样. CSS3具有background-size属性.不确定其可靠性.
Image resizing is different from image display dimensions. I hope you are asking about how to display image in the custom size. An example markup would be
(in html)
<img id="MainContent_Image1" src="Test.jpg" style="height:50px;width:50px;" />
if webserver control then the markup would be
<asp:Image ID="Image1" ImageUrl="~/Test.jpg" Width="50" Height="50" runat="server" />
Which display the image 50 x 50 pixels
I understood you want the image as a background. What you can do is resize the image as shown above. Make the position absolute and place it exactly above your tag. Then set its z-index to -1000.So it act like a background. CSS3 has background-size property. Not sure the reliability of that.
我不确定您在那做什么,但是尝试设置max-width:100%
.
I''m not sure what you''re doing there, but try setting max-width:100%
.
这篇关于图片是否在表格内的标签中调整大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文