Ver Mensaje Individual
  #8 (permalink)  
Antiguo 24/12/2011, 18:14
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Intentando hacer triángulos en CSS

bueno, estuve analizando el ejemplo en particular, y no solo la generación de las flechas

hice esto, que por lo pronto funciona en IE7+ (si la F12 de ie9 no me engaña), Chrome. FF, opera, Safari. Sirve con un input submit tanto como con un div.

Se puede optimizar, y habría que buscar corregir algun detalle con la alineación vertical de los textos del boton y del input text
Y el efecto hover, lo modifique un poco (me gustó más)
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6.  
  7. <style type="text/css">
  8. /*<![CDATA[*/
  9.  
  10. .contiene_input{
  11. padding: 0;
  12. margin: 0;
  13. border: none;  
  14. height: 26px;
  15. }
  16.  
  17. .contiene_input input{
  18. float:left;
  19. border: none;
  20. background-color:#3A6411;
  21. padding: 1px 2px 0px 2px;
  22. margin: 0;
  23. width: 200px;
  24. height: 25px;
  25. }
  26.  
  27. .contiene_input div{
  28. float:left;
  29. background-color:#3A6411;
  30. padding: 0;
  31. margin: 0;
  32. height: 100%;
  33. }
  34.  
  35. .flecha-izq {
  36.  border-color: transparent white transparent transparent;
  37.  border-style:solid;
  38.  border-width:5px;
  39.  margin-top: 7px;
  40.  width:0;
  41.  height:0;
  42.  display: inline-block;
  43. }
  44.  
  45. .ccolor {
  46. background-color: #fff !important;
  47. }
  48. .f-tres {
  49. border-color: transparent #3A6411 transparent transparent !important;
  50. margin-left: -5px;
  51. clear: both;
  52. }
  53.  
  54. .f-dos {
  55. border-color: transparent red transparent transparent !important;
  56. margin-left: -5px;
  57. clear: both;
  58. }
  59.  
  60. div.texto {
  61. padding: 0 8px;
  62. background-color: red;
  63. }
  64.  
  65. input.texto {
  66. width: 80px;
  67. height: 26px;
  68. }
  69.  
  70. div.texto:hover, input.texto:hover{
  71. margin-left: -5px;
  72. cursor: pointer;
  73. }
  74.  
  75. /*]]>*/
  76. </head>
  77. <div>
  78. <p>Con un div</p>
  79. <div class="contiene_input">
  80. <input type="text" /><div><span class="flecha-izq"><!-- flecha --></span></div><div class="ccolor"><span class="flecha-izq f-dos"><!-- flecha --></span></div><div class="texto">texto</div>
  81.  
  82. </div>
  83.  
  84. <p>Con un input submit</p>
  85. <div class="contiene_input">
  86. <input type="text" /><div><span class="flecha-izq"><!-- flecha --></span></div><div class="ccolor"><span class="flecha-izq f-tres"><!-- flecha --></span></div><input type="submit" class="texto" value="procesar" />
  87. </div>
  88. </div>
  89. </body>
  90. </html>

Parto a la cena navideña/familiar
Un saludo y Feliz Navidad para todos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.