Ver Mensaje Individual
  #12 (permalink)  
Antiguo 13/06/2009, 12:33
hwelt
 
Fecha de Ingreso: marzo-2008
Ubicación: Patzún, Chimaltenango
Mensajes: 71
Antigüedad: 16 años, 1 mes
Puntos: 0
Exclamación Respuesta: diferencias con <div id=""> con <div class="">

Cita:
Iniciado por caricatos Ver Mensaje
Hola:

Los id's se referencian con el prefijo "#" y las clases con "."
Un id debe ser único y una clase puede ser referenciada por muchos elementos, incluso un elemento puede tener 2 clases.

Para aplicar estilos es mejor hacerlo con clases, aunque para casos aislados valen los id's... y además se referencian mejor con javascript.

Saludos
Me parece que es buena aportacion la tuya solo que una observacion muy severa.

Es totalmente lo contrario...

EN SERIO es ALREVES

fijense esto que encontre en la pagina oficial de www (punto) w3 (punto) org

He aqui...
Código PHP:
Rules for style rule precedences and inheritance depend on the style sheet language.

The following CSS STYLE declaration puts a border around every H1 element in the document and centers it on the page.

<
HEAD>
 <
STYLE type="text/css">
   
H1 {border-width1bordersolidtext-aligncenter}
 </
STYLE>
</
HEAD>

To specify that this style information should only apply to H1 elements of a specific class, we modify it as follows:

<
HEAD>
 <
STYLE type="text/css">
   
H1.myclass {border-width1bordersolidtext-aligncenter}
 </
STYLE>
</
HEAD>
<
BODY>
 <
H1 class="myclass"This H1 is affected by our style </H1>
 <
H1This one is not affected by our style </H1>
</
BODY>

Finallyto limit the scope of the style information to a single instance of H1set the id attribute:

<
HEAD>
 <
STYLE type="text/css">
   
#myid {border-width: 1; border: solid; text-align: center}
 
</STYLE>
</
HEAD>
<
BODY>
 <
H1 class="myclass"This H1 is not affected </H1>
 <
H1 id="myid"This H1 is affected by style </H1>
 <
H1This H1 is not affected </H1>
</
BODY