Ver Mensaje Individual
  #13 (permalink)  
Antiguo 13/06/2009, 12:53
kseso?
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: diferencias con <div id=""> con <div class="">

Por favor, señores Admin/mod
Han tenido que pasar 3 años
NO BORREN EL TEMA ni lo CIERREN
Que Caricatos pueda responder


Cita:
Iniciado por hwelt Ver Mensaje

Cita:
Iniciado por caricatos
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.

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
__________________
Por una web con mucho estilo
+++ CUENTA ABANDONADA. ¿la quieres? +++

Última edición por kseso?; 13/06/2009 a las 13:12