css隐藏input 文字

Published by Sean_Loo at 2008-3-19 with 0 review(s), ? hits. [Articles]

我们来看下面的代码,成功的实现了隐藏input 文字。但分为三种情况,我们在后面进行分析。


    [ 可先修改部分代码 再运行查看效果 ]

我们需要特别注意的是下面的代码:

input {
 margin:5px 0;
 width:200px;
 height:20px;
 display:block;
 overflow:hidden;
 background:#f9f9f9;
 border:1px solid orange;
}

我们看下面的分析:

第一种方法

input.a {
 ie:expression(bb.value="提交");
 text-indent:-200em;
}
 

在opera上有问题

第二种方法

input.b {
 padding-top:20px;
}

  如果这个值太小了在opera上文字还是可见,所以设置大一些就没问题了,但FF中又会出现把高度撑大的现象;

第三种方法

input.c {
 font-size:100em
}

  这种方法应该说是兼容性最好的
  FF有点bt.在padding的时候,IE,OPEAR的高度与宽度都不变,就FF变。

http://www.xvdesign.com/articles/css_hide_input.html



News and coming

Directories

抓虾 Rojo
google reader bloglines
my yahoo 哪吒

Resources

Status

  • []Writings
  • []Reviews
  • lx-super[A]163.comSean_Loo
鄂ICP备07004579号 Powered by Sean_Loo. All right reserved. W3CSitemap