bug:inline-block間距bug的調整

來源:互聯網
上載者:User

標籤:style   blog   http   color   使用   ar   2014   div   

<div id="one">        <a href="">首頁</a>        <a href="">首頁</a>        <a href="">首頁</a>        <a href="">首頁</a>        <a href="">首頁</a></div>
*{            margin:0;            padding:0;        }        div a{            display: inline-block;            text-align: center;            width:70px;            background-color: #A9A9A9;        }        #one a:link{            color:white;        }        a:hover{            background-color: red;            color:green;        }

 

方法一:使用word-spacing或者letter-spacing 

#one{            word-spacing: -10px;        }#one a{            word-spacing:0px;        }

方法二:使用margin的負值

#one a{            margin-rignt:-10px;        }

更多內容請看:

  http://www.zhangxinxu.com/wordpress/2012/04/inline-block-space-remove-%E5%8E%BB%E9%99%A4%E9%97%B4%E8%B7%9D/

以及:

  http://www.zhangxinxu.com/wordpress/2010/11/%E6%8B%9C%E6%8B%9C%E4%BA%86%E6%B5%AE%E5%8A%A8%E5%B8%83%E5%B1%80-%E5%9F%BA%E4%BA%8Edisplayinline-block%E7%9A%84%E5%88%97%E8%A1%A8%E5%B8%83%E5%B1%80/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.