Instagram | Twitter | LinkedIn
Considering the following code, What would you see in the browser ?
Click here to see the correct answer and explanation 馃憖
| Correct Answer | Explanation |
|---|---|
| B | .box .color select all elements with the class name color that are decendents of the element with the class name box, but, .box.color select the element which has a class name box and also a class name color (Like <div class="box color"></div>). |
Explanation based on 馃憠馃徏 Multiple Class / ID and Class Selectors | CSS Tricks
Code:
HTML:
<div class="box">
<div class="size color"></div>
</div>
CSS:
.size {
width: 100px;
height: 100px;
}
.box .color {
background: yellow;
}
.box.color {
background: pink;
}
Considerando el siguiente c贸digo, 驴Qu茅 ver铆as en el navegador?
Haz click aqu铆 para ver la respuesta correcta y su explicaci贸n 馃憖
| Respuesta correcta | Explicaci贸n |
|---|---|
| B | El selector .box .color selecciona los elementos con clase color que sean descendientes del elemento con clase box, en cambio, el selector .box.color selecciona el elemento que tenga la clase box y tambi茅n la clase color (Algo como <div class="box color"></div>). |
Explicaci贸n basada en 馃憠馃徏 Multiple Class / ID and Class Selectors | CSS Tricks
C贸digo completo:
HTML:
<div class="box">
<div class="size color"></div>
</div>
CSS:
.size {
width: 100px;
height: 100px;
}
.box .color {
background: yellow;
}
.box.color {
background: pink;
}

Cool, gracias me ayuda un monton a repasar una que otra cosa ya que hacer estilos en css me parece mas complejo que en flutter
En que haces los dise帽os? estan hermosos