PRIORIDADES DE ESTILOS. ROSA LORRIO
CSS definido en esta página | ||
---|---|---|
TIPO | CODIGO | PRIORIDAD |
ESTILO A ELEMENTO | h1{background-color: yellow;} | 0001 |
ESTILO A CLASE | .cabecera{background-color:blue;} | 0010 |
ESTILO A ID | #caja{background-color:pink;} | 0100 |
ESTILO EN LINEA | <h1 style="background-color: orange">Cabecera: header</h1> | 1000 |
EJEMPLOS DE CÓDIGO | |
---|---|
CÓDIGO HTML | RESULTADO |
H1 con estilo aplicado al ELEMENTO:<h1>Cabecera: header</h1> |
Cabecera: header |
Estilo aplicado al elemento mediante una CLASE <h1 class="cabecera">Cabecera: header</h1> |
Cabecera: header |
Estilo aplicado al elemento mendiante un ID: <h1 class="cabecera" id="caja">Cabecera: header</h1> |
Cabecera: header |
Estilo aplicado EN LINEA: <h1 class="cabecera" id="caja" style="background-color: orange">Cabecera: header</h1> |
Cabecera: header |
Estilos aplicados sobre distintos elementos anidados: <div id="caja"> |
Cabecera: header |