CSS 用div畫一個1px高的細線 (IE 6 版)

來源:互聯網
上載者:User

問題:
div{
    background: #f00;
    height: 1px;
}

<div></div>

目的:我想用DIV做一個1PX高的細線。

*以下IE版本主要為IE6.IE7的表現情況與firefox基本相同.

在100PX時和1PX時,FF都正常。 但是在height屬性小於8px時, IE高度就不變了, IE認識100PX為什麼就不認識1PX呢。
處理方法:

================================================

代碼
<style>
div
{
    background: #f00;
    height: 1px;
    overflow:hidden;
}
</style>

<div></div>

================================================

相關文章

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.