Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/01/2010, 08:25
Avatar de neodani
neodani
 
Fecha de Ingreso: marzo-2007
Mensajes: 1.811
Antigüedad: 17 años, 1 mes
Puntos: 20
Respuesta: Puede haber un id y un class en un mismo tag html?

Cita:
Iniciado por JavierB Ver Mensaje
Hola neodani

Haciendo una sencilla prueba:

Código CSS:
Ver original
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. #direccion {background:green; width:200px}
  5. .estilo1 {background:red; width:50px}
  6. </style>
  7. </head>
  8. <body>
  9. <input type="text" tabindex="5" maxlength="40" size="25" value="" id="direccion" class="estilo1" name="direccion"/>
  10. </body>
  11. </html>

Parece ser que sí pueden ponerse los dos y que prevalece el id

Saludos,
Muchas gracias, es cierto y se complementan bien...

Código HTML:
Ver original
  1. <style type="text/css">
  2. #direccion {background:green; }
  3. .estilo1 {color:red; width:200px}
  4. </head>
  5. <input type="text" tabindex="5" maxlength="40" size="25" value="" class="estilo1" id="direccion"  name="direccion"/>
  6. </body>
  7. </html>

Salu2!