Ocultar Texto del Boton Submit con CSS
Aquí está la solución para deshacerte del texto de los botones submit mediante CSS, y no solo eso, también vamos a reemplazar el botón con una imagen.
No te vas a creer el parche que he tenido que usar para hacerlo funcionar en IE6… en serio, ¿cuándo demonios va a morir este navegador? Otra pesadilla de mañana gracias a él.
El Código HTML
<input type="submit" class="form-submit" value="Search" id="edit-submit" name="op"/>
El Código CSS
#edit-submit {
width: 25px;
height: 25px;
text-indent: -9999px;
background: url(../images/icon-search-25x25.gif) left top no-repeat; /* ruta hacia tu imagen */
border: none;
margin: 0 0 0 10px;
padding: 0;
color: transparent;
text-transform: capitalize; /* Este es el parche para IE
*/
}
Si, sé que parece ridiculo usar la propiedad text-transform para hacer desaparecer el texto, pero estamos hablando de IE6.
Disfruta y convence a tus clientes de que paren de usar IE6.
Home
agosto 18th, 2009 at 13:20
thanks! this totally fixed me up!
agosto 25th, 2009 at 15:20
Declaring a line-height also seems to work. It seems to be related to IE6 thinking button text is not actually text. So you then have to convince it.
junio 10th, 2010 at 21:20
[...] definitiva, la solución que encontré en esta entrada y que posteriormente apliqué consiste en este código [...]