html - h5表格与表格间距的问题
PHP中文网
PHP中文网 2017-04-17 13:11:49
0
2
928

我写html,最开头用<!DOCTYPE html>的h5声明,写了三个表格,得到下面的效果

(就是在三个表格中分别放了图片)但是表格与表格之间有明显的间距,设置了cellspacing=0,cellpadding=0,表格坍塌也设置了,css控制了td高度,还是不能解决表格间间距的问题。

我不知道这多出来的5px哪里来的。
然后我把最开始的html声明换成了:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
三个表格之间的间距就消失了,而且td多出来的5px也没有了。

有哪位大侠可以告诉为什么会这样子吗???!!!研究了好久都不知道为什么。
<!doctype html>不是h5的标准声明吗?为什么它的表格td中会多出5px?而之前版本的html就没有这个问题呢?急啊~!

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
伊谢尔伦

It may be the browser default. You first set the padding margin to 0 in the css, and then try setting the spacing you want

PHPzhong

I haven’t turned on my computer at the moment. If removing the browser’s default style doesn’t work, check to see if it’s because the picture is stretched

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!