+ -
当前位置:首页 → 问答吧 → 为什么图片不居中????奇怪了

为什么图片不居中????奇怪了

时间:2010-09-25

来源:互联网

已给了text-align:center;但没效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <style type="text/css"> *{margin:0;padding:0;} ul{ width:500px; height:101px; border:1px solid orange; list-style:none outside none; margin:55px auto; } ul li{ float:left; width:200px; margin-right:25px; height:100px; text-align:center; } ul li img{ float:left; border:none; } ul li .list{ width:200px; text-align:center; height:100px; } </style> </head> <body> <ul> <li> <div class="list"> <table width="200" cellspacing="0" cellpadding="0" border="0"> <tr> <td width="200" valign="middle" height="100" align="center"> <a href=""><img src="http://vpic4.sinaimg.com.cn/df/73/1761139.gif" /></a> </td> </tr> </table> </div> </li> <li> <div class="list"> <table width="200" cellspacing="0" cellpadding="0" border="0"> <tr> <td width="200" valign="middle" height="100" align="center"> <a href=""><img src="http://vpic4.sinaimg.com.cn/df/73/1761139.gif" /></a> </td> </tr> </table> </div> </li> <li> <div class="list"> <table width="200" cellspacing="0" cellpadding="0" border="0"> <tr> <td width="200" valign="middle" height="100" align="center"> <a href=""><img src="http://vpic4.sinaimg.com.cn/df/73/1761139.gif" /></a> </td> </tr> </table> </div> </li> </ul> </body> </html>
 提示:您可以先修改部分代码再运行

作者: rao3324180   发布时间: 2010-09-25

ul li img{
              float:left;
我都没看效果就发现有问题了...你没事吧?

作者: leilay   发布时间: 2010-09-25