A Pen by Joel Alejandro Villarreal Bertoldi on CodePen.
Created
September 4, 2020 23:47
-
-
Save joelalejandro/8879db43209e25445a9931f483cb9903 to your computer and use it in GitHub Desktop.
Ejemplo de selectores anidados en CSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <nav class="menu"> | |
| <ul> | |
| <li class="opcion"> | |
| <a target="_blank" href="#">Opción 1</a> | |
| </li> | |
| <li class="opcion"> | |
| <a href="#">Opción 2</a> | |
| </li> | |
| <li class="opcion"> | |
| <a href="#">Opción 3</a> | |
| </li> | |
| <li class="opcion"> | |
| <a target="_blank" href="#">Opción 4</a> | |
| </li> | |
| <li class="opcion"> | |
| <a class="menu__opcion__enlace" href="#">Opción 5</a> | |
| </li> | |
| </ul> | |
| </nav> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Restricciones de CSS */ | |
| nav.menu .opcion > a[target="_blank"] { | |
| color: red; | |
| } | |
| /* BEM (Block / Element / Modifier) */ | |
| .menu__opcion__enlace { | |
| color: red; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment