Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/06/2013, 08:53
edu_leon93
 
Fecha de Ingreso: junio-2013
Mensajes: 2
Antigüedad: 10 años, 11 meses
Puntos: 0
Respuesta: Problema al crear boton con Div

Cita:
Iniciado por C2am Ver Mensaje
Hola y bienvenido
No sé que pretendes hacer, pero te dejo pequeño ejemplo de boton css.
Supongo que tendrá cosas a corregir, pero bue:
Código HTML:
Ver original
  1. <div class="button">
  2. <a href="#">
  3.     REGISTRARSE
  4. </a>
  5. </div>

Código CSS:
Ver original
  1. .button {
  2.     width: 300px;
  3.     height: 55px;
  4.     display: inline-block;
  5.     text-align: center;
  6.     background-color: #00ACE4;
  7.     border-radius: .15em;
  8.     vertical-align:middle;
  9.     position:relative;
  10. }
  11.  
  12. div.button:before{
  13.     content:"";
  14.     display:block;
  15.     width:296px;
  16.     height: 22.5px;
  17.     color:black;
  18.     border-radius: .15em;
  19.     background-color: rgba(250,250,250,.6);
  20.     position:absolute; left: 2px; top:2px;
  21.    
  22.     -webkit-transition: top .5s -.1s;
  23.      -moz-transition: top .5s -.04s;
  24.      -o-transition: top .5s -.04s;
  25.      -ms-transition: top .5s -.04s;
  26.       transition: top .5s -.04s;
  27. }
  28.  
  29.  
  30. .button a{
  31.     color: #FFF;
  32.     display:block;
  33.     font: bold 1.5em 'klavika_rgregular', helvetica, sans-serif;
  34.     height:55px;
  35.     line-height:55px;
  36.     position:relative;
  37.     text-decoration: none;
  38.     text-shadow:1px 1px 1px #333;
  39.     width:100%;
  40.     z-index:100;
  41.    
  42.         -webkit-transition: color .5s;
  43.      -moz-transition: color .5s -.04s;
  44.      -o-transition: color .5s -.04s;
  45.      -ms-transition: color .5s -.04s;
  46.       transition: color .5s;
  47. }
  48. div.button:hover:before{
  49.     background-color: rgba(250,250,250,.3);
  50.     top:30.5px;
  51. }
  52. .button a:hover{
  53.     color:#333;
  54.     text-shadow:-1px -1px 1px #eee;
  55. }

Y un ejemplo: [url]http://jsfiddle.net/c2am/G4bHV/138/embedded/result/[/url]

Sobre el uso de pseudo elementos: [url]http://librosweb.es/css_avanzado/capitulo_3/pseudo_elementos.html[/url]

Saludos
Exactamente algo así era lo que trataba de hacer.

Bien, no me explique de la forma adecuada, pero ayer lo hice algo parecido pero incluyendo gradientes en background en vez de los div before, muy buena idea!

Muchas gracias por tu ayuda, y me paso a leer las ligas que me mandaste!.

Saludos!