Jerarquía de Estilos en CSS #170
Ivano93
started this conversation in
Show and tell
Replies: 1 comment
-
Gracias por la info. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
¡Buena noche a todos, explorers!
Para quienes tenían curiosidad acerca de cómo se van sobrescribiendo los estilos al declararlos en CSS, van así (mayor a menor importancia):
.first-class { color: pink !important; }
<h1 style="color: red;"> Hello World! </h1>
#id-tag{ color: orange; }
.first-class { color: pink; }
.second-class { color: blue; }
body { color: green; }
Por ejemplo, si tuviéramos todos estos estilos juntos:

La salida del texto sería en color ROSA, por la declaración del !important tag en la clase ".first-class":

Espero les sea de ayuda.
Saludos,
H. Iván Hdz.
Beta Was this translation helpful? Give feedback.
All reactions