Dux-Courses Evaluaciones
DOCUMENTATIONCOURSESROADMAPRANKINGBLOGPLAYGROUND
LoginSign Up
Aurum-Courses

Aurum Courses is an advanced learning and evaluation platform designed to accelerate your tech career. We provide an immersive environment filled with challenges, technical documentation, and verifyable certificates for frontend, backend, and fullstack technologies.

Platform Links

  • Interactive Courses
  • Technical Documentation
  • Tech Blog & Articles
  • Mi Perfil y Progreso

About the Project

  • About the Project
  • Contact & Support

Legal & Compliance

  • Privacy Policy
  • Terms of Service
  • Cookies Management
© 2026 Aurum-Courses. All rights reserved. Made with passion for the developer ecosystem.

Desarrollado por Aurumdux

Docs/CSS/Cascada y Especificidad
Avanzadocss

Cascada y Especificidad

Entiende como CSS decide que estilos aplicar cuando hay conflictos: cascada, herencia y especificidad.

Como funciona la especificidad

La especificidad determina que regla "gana" cuando varias aplican al mismo elemento. Se calcula como un vector de 4 componentes: inline > ID > clase > elemento. - Estilos inline: (1,0,0,0) - ID (#id): (0,1,0,0) - Clase (.clase), atributo, pseudo-clase: (0,0,1,0) - Elemento (div), pseudo-elemento: (0,0,0,1)

Ejemplos de especificidad

Es fundamental entender la especificidad para depurar conflictos de estilos sin recurrir a !important.
css
1/* Especificidad: 0,0,0,1 */
2p { color: black; }
3
4/* Especificidad: 0,0,1,0 */
5.destacado { color: blue; }
6
7/* Especificidad: 0,0,1,1 */
8p.destacado { color: green; }
9
10/* Especificidad: 0,1,0,0 */
11#titulo { color: red; }
12
13/* Especificidad: 0,1,1,0 - GANA */
14#titulo.activo { color: purple; }
15
16/* Evita !important salvo casos excepcionales */
17/* .error { color: red !important; } */
18
19/* Mejor: usa una clase mas especifica */
20.form .field .error-message { color: red; }
← AnteriorTransiciones y AnimacionesSiguiente →CSS Moderno