在< td>中强制某个宽度/高度溢出 [英] Forcing a certain width/height with overflow in a <td>
问题描述
我有一个< table>
和 table-layout
设置为 ,所以所有显式的宽度/高度定义被尊重,无论什么。我试图得到一个< td>
溢出,但即使我做了 table-layout:fixed $ c $
它不会工作,因为< td>
将始终具有图像的大小
您可以使用height和width属性。如果图片大小为400x300,则输入< img src =...height =100width =100/>
p>
如果您要裁剪图片,请使用
< style&
#id {
background:url(...)no-repeat; / *你可以在这里使用background-position css属性... * /
height:100px;
width:100px;
< / style>
< div id =image>< / div>
I have a <table>
with table-layout
set to fixed, so that all explicit width/height definitions are respected no matter what. I'm trying to get a certain <td>
to overflow, but even though I did the table-layout: fixed
it doesn't work.
What should I do to make it work?
It won't work because the <td>
will always have the size of an image
You can use height and width attributes. If the image size is 400x300, typing <img src="..." height="100" width="100" />
will show 100x100 image
If you want to crop an image use
<style>
#id{
background:url(...) no-repeat; /* you can use background-position css property here... */
height:100px;
width:100px;
</style>
<div id="image"></div>
这篇关于在< td>中强制某个宽度/高度溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!