The
" Below is a reference fragment: <! doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http:// Www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312" /> <title> ways to hide input text </title> <style type= "Text/css" > / *<! [cdata[*/ input { margin:5px 0; width:200px; height:20px; display:block; overflow:hidden; background: #f9f9f9; border:1px solid orange; } input.a { ie:expression (bb.value= "submit"); text-indent:-200em; } input.b { padding-top:20px; } input.c { font-size: 100em /*]]>*/ </style> <body> <input type= but Ton " value=" submit " id=" BB " class=" a " /> <input type=" button " value=" Submit " class= "B" /> <input type= "button" value= "Submit" class= "C" /> </ Body> </body> |
What we need to register specifically is the following code:
The following is a reference fragment: Input { margin:5px 0; width:200px; height:20px; Display:block; Overflow:hidden; Background: #f9f9f9; border:1px solid Orange; } |
Let's look at the following analysis:
The first method
below is a reference fragment: input.a { ie:expression (bb.value= "Submission"); text-indent:-200em; } |
problems with opera
& nbsp; the second method
the following is a reference fragment: input.b { padding-top:20px; } |
If the value is too small the text is still visible on opera, so setting a larger number is fine, but FF There will be the phenomenon of high support;
The third method
Following is a reference fragment: input.c { font-size:100em } |
& Nbsp; &nbSp This method should be said to be the best compatibility.