我把图片放在td里,想随着浏览器宽度自动变,最大是图片宽度,高度也自动。但是td下总是有个空隙。。。
html:
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>FD100</title> <meta content-type:"text/html" charset="utf-8"> <meta name="keywords" content="FD100" /> <meta name="description" content="FD100" /> <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> <meta name="description" content=""> <meta name="author" content=""> <!-- CSS <link rel="stylesheet" href="../assets/css/reset.css"> <link rel="stylesheet" href="../assets/css/supersized.css">--> <link rel="stylesheet" href="kx100-m.css"> </head> <body> <div class='page-container'> <table> <tr><td> <img src='kx100shouji_01.png'/ alt="各位大侠,这个td上面的image白边怎么也去不掉,能帮忙不?_html/css_WEB-ITnose" ></td></tr> <tr><td> <img src='kx100shouji_02.png'/ alt="各位大侠,这个td上面的image白边怎么也去不掉,能帮忙不?_html/css_WEB-ITnose" ></td></tr> </table> </div> <!-- Javascript <div class="error"><span>+</span></div>--> <!-- <script src="../assets/js/jquery-1.8.2.min.js"></script> <script src="../assets/js/supersized.3.2.7.min.js"></script>--> <!-- <script src="../assets/js/supersized-couponinput.js"></script> <script src="../assets/js/scripts.js"></script>--></body></html>
body { background: #ffffff;/*#f8f8f8;*/ font-family: 'PT Sans', Helvetica, Arial, sans-serif; text-align: center; color: #fff;}.page-container { margin: 0px auto 0 auto;}table { width: 100%; margin:0 auto; background: #2d2d2d; /* browsers that don't support rgba */ background: rgba(45,45,45,.15); font-family: 'PT Sans', Helvetica, Arial, sans-serif; font-size: 20px; border: none; border-collapse: collapse; position:absolute; /*border-spacing:0;*/ text-shadow: 0 1px 2px rgba(0,0,0,.3);}td{ /* max-width:100%; Mozilla才支持一个max-width 的CSS语法 */ background: #ffffff; /*border: none; solid #000 1px;*/ vertical-align:center; text-align:center; color: #000; padding:0; margin-bottom:0; /* 加边框看效果 */ border-width: 1px; border-style: solid; border-color: #666666;}/* 图片自动缩放设备屏幕宽度 */img{ max-width:100%;}
删除tr td table里面多余的空格
为啥你不把一张图片放在一行内
tr td{margin:0;padding:0;border:0;}