freeCodeCamp/guide/spanish/certifications/responsive-web-design/basic-css/override-all-other-styles-b.../index.md

34 lines
1010 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Override All Other Styles by using Important
localeTitle: Anular todos los otros estilos usando Importante
---
## Anular todos los otros estilos usando Importante
Puede anular todos los demás estilos en CSS usando `!important` .
Esta anulación se considera la más importante y tiene prioridad sobre el resto.
La lista de los más importantes a los menos importantes es la siguiente: \`\` \`
1. importante (! importante)
2. estilos en línea
3. declaraciones de identificación
4. declaraciones de clase
```
Here is an example of how to write/apply !important:
```
css color: negro! importante;
```
To apply these in context and see `!important` take precedence, here is an example:
```
html
body { font-family: Helvetica; color: purple; } #violet-text { color: violet; } .black-text { color: black !important; } .blue-text { color: blue; }
# Texto de ejemplo
\`\` \`
Este resultado terminaría en el `Example Text` es negro debido a que se agregó `!important` al `color: black` .