css样式--浏览器兼容问题

来源:百度知道 编辑:UC知道 时间:2024/06/05 10:02:36
css代码:
ul{ list-style:none; margin:0px;}

ul li{float:left;margin-right:10px;}

li a{background:#f2f2f2; display:block;width:122px; height:117px; text-align:center;padding-top:5px;border:#ccc 1px solid; text-decoration:none;color:#FFFFFF;line-height:24px;}

li a:hover{background:#cbe9f3;border:#33CCFF 1px solid; }

li a .pho{width:110px; height:80px; background:red;margin:auto; cursor:pointer;}

li a .name{width:110px; height:24px; margin:auto;margin-top:5px; cursor:pointer; background-color:#ddd; }

li a:hover .name{ background-color:#0099FF;}

img{border:0;}

html代码:

<ul>
<li>
<a href="http://baidu.com">
<div class="pho">
<img src="123.jpg" width="110" height="80" />
</div>
<div class=&

不写在<A>里需要写鼠标事件了 已经解决了 谢谢你

应该没问题的,
你也可以这么写
<ul>
<li>

<div class="pho"> <a href="http://baidu.com">
<img src="123.jpg" width="110" height="80" /> </a>
</div>
<div class="name">
<a href="http://baidu.com"> ddd</a></div>

</li>
</ul>

为什么在<a></a>里面嵌套div呢?
把div放外面比较好吧?