作者flyingIdea (飞翔的想法)
看板Web_Design
标题[问题] table里塞图片 超出来的就隐藏
时间Wed Apr 24 22:42:43 2013
<table align="center"
style="height: 500px; width: 1000px; table-layout: fixed;
overflow: hidden;"
frame="border" rules="none" cellpadding="5">
<tr>
<td><img src="aaa.jpg"> </td>
</tr>
</table>
以上是我精简了我的写法....
用table-layout:fixed去限制他的总栏位大小
aaa.jpg是一张超过 1000x500的图
但是我放出来後只有X轴有被功成1000
而Y轴一样会撑开到他原本的大小
我也试过放在TD里
但是是没有用的....
请问一下有辨法让他X和Y轴的size被固定吗?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 1.174.248.46
※ 编辑: flyingIdea 来自: 1.174.248.46 (04/24 22:46)
1F:推 s25g5d4:哪里有aaa.jpg? 04/24 22:48
後来我又贴上一次盖过去了XD
※ 编辑: flyingIdea 来自: 1.174.248.46 (04/24 22:52)
2F:推 s25g5d4:overflow: hidden试看看 04/24 23:38
加了~一样没用@@~
※ 编辑: flyingIdea 来自: 1.174.248.46 (04/24 23:42)
3F:→ iceblue7x:外面加一层div,overflow、height写在div上 04/24 23:57
4F:推 mobi76:我都直接把img设td background XD 04/25 02:10
5F:→ mobi76:然後td设width hieght 04/25 02:12
6F:→ tyf99:table 加上 display: block,block 才能用 overflow 04/25 02:12
7F:→ tyf99:background 行不通,背景图只能是 100% size 04/25 02:13
8F:→ flyingIdea:感谢tyf99!!成功了!! 04/25 21:32