雙倍邊距bug

來源:互聯網
上載者:User

標籤:style   class   blog   java   color   get   

<!DOCTYPE html><html><head lang="en">    <meta charset="UTF-8">    <title></title>    <style>        *{margin: 0; padding: 0;}        li{width: 59px;            height: 87px;            float: left;            margin: 20px;            background: #333333;            position: relative;            list-style: none;        }
/**display:inline;zoom:1   *vertical:top margin: 20px;改成 margin:0 20px;如果給ul浮動就沒事了 雙倍邊距bug的條件 浮動 外編劇 塊狀元素 解決雙倍邊距bug
#div1{width: 594px; margin: 50px; border-top:1px solid #333;} #div1 ul li div{ width: 232px; height: 143px; background: #666666 url("img/tip.png") no-repeat; position: absolute; top: -150px; left: 20px; display: none; }
</style> <script> window.onload=function(){ var aLi= document.getElementsByTagName("li") for(var i=0; i<aLi.length;i++){ aLi[i].onmouseover=function(){ this.getElementsByTagName("div")[0].style.display="block"; } aLi[i].onmouseout=function(){ this.getElementsByTagName("div")[0].style.display="none"; } } } </script></head><body><h1>最新上線</h1><div style="1px solid #000;" id="div1"> <ul class="ul1"> <li><img src="img/1.png" ><div></div></li> <li><img src="img/2.png"><div></div></li> <li><img src="img/3.png"><div></div></li> <li><img src="img/4.png" ><div></div></li> <li><img src="img/5.png" ><div></div></li> <li><img src="img/6.png" ><div></div></li> </ul> <ul class="ul1"> <li><img src="img/7.png"><div></div></li> <li><img src="img/8.png"><div></div></li> <li><img src="img/9.png"><div></div></li> <li><img src="img/10.png"><div></div></li> <li><img src="img/11.png"><div></div></li> <li><img src="img/12.png"><div></div></li> </ul></div></body></html>

  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.