input 与button垂直差1px 在IE6下


clipboard.png


 html


 <div class="search">
    <input class="search_input" type="text">
    <button class="search_btn ficon">搜</button>
</div>


 css


 .search {
      font-size: 0;
    }
    .search .search_input, .search .search_btn {
      vertical-align: top;
      background-color: #333;
      color: #999;
      zoom: 1;
      *display: inline;
    }
    .search .search_input {
      width: 140px;
      height: 30px;
      line-height: 30px\9;
      padding: 0 5px;
      border:none;
    }
    .search .search_btn {
      height: 30px;
      font-size: 24px;
      cursor: pointer;
      text-align: center;
      padding: 0 5px;
      line-height: 30px;
         border:none;
    }
    .search .search_btn:hover {
      color: #bcbcbc;
    }

internet-explorer-6 qianduan 浏览器兼容性 css

里昂马格纳斯 11 years, 10 months ago

试试 vertical-align:middle;

或者改用float布局。就能对齐了。

sdsd- answered 11 years, 10 months ago

Your Answer