css - html表格 td 宽度随着固定为内容宽度
PHP中文网
PHP中文网 2017-04-17 11:50:29
0
2
547

在一个表格td里面放了一个img 因为高度宽度比例不确定,所以只能固定高度,宽度自适应,但是td的宽度始终比img要宽得多,怎么才能让td的宽度就等于img的宽度?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
巴扎黑

If you want to make td and img have the same width and height, just set the width or height of td, and then insert the width=100% or height=100% of img to make the height or width adaptive, so that img will be You can open the TD.

Peter_Zhu

https://jsfiddle.net/wj6tqvmr/1/

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template