梁龙的博客

80后出生于大陆最南端,专注于WEB技术的学习!

Jun
5

input style兼容IE6的方案

        FF与IE7下input type="text" 和 input type="password"输入框的长度都是一样的,但在IE6下偏偏前面的长后面的短2px,设置size也不行,而设置width可以,但为了不影响其他input(如type=submit)的width,我们可以这样写css:
 

  1. input[type="text"], input[type="password"] {   
  2.     width: 200px;   
  3. }   
  4.   
  5. input {   
  6.     width: expression((this.type=="text" || this.type=="password") ? "200px" : "style");   
  7. }  

前面的写法是照顾FF,后面的写法是照顾IE

 

« 趁年轻多点运动终于拿到了第一笔工资 »
  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

RSS订阅

    &25235;&34430; pageflakes Rojo &29399;&29399; google reader bloglines my yahoo newsgator netvibes &40092;&26524; &21738;&21522; &26377;&36947;

日历

Search

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Spirit Build 80722

Copyright 梁龙的博客 lianglong.net.cn All Rights Reserved.