拉伸图像以适应td [英] Stretch image to fit in td

查看:118
本文介绍了拉伸图像以适应td的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的td细胞中拉伸图像。怎么做。它是一个标签图像,看起来像这个| ________ |的倒转。我需要将图像放置在第一个包含文本aaa的td单元格中,该图像将位于此图像的中心。 解决方案

你不能在不使用CSS3的情况下展开背景图片。

CSS3 中, background-size 财产,您可以给100%将图像拉伸至100%的容器。但是所有浏览器都不支持CSS3。



您可以使用图片标签并将宽度和高度设置为100%来实现此目的。


I want to stretch an image in my td cell. How to do that. Its is a tab image which looks like inverted of this |________|. I need to place the image in the first td cell which contains the text 'aaa' will come in center of this image.

解决方案

You cannot stretch a background image without using CSS3.

In CSS3 you have background-size property for which you can give 100% to stretch the image to 100% of the container. But CSS3 isn't supported in all browsers.

You can use an image tag and give the width and height to 100% to achieve this.

这篇关于拉伸图像以适应td的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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