Instagram | Twitter | LinkedIn
Consider the following code:
| CSS | HTML |
|---|---|
![]() |
![]() |
What is the size of the baby element ?
A. width: 200px; height: 100px;
B. width: 200px; height: 200px;
C. width: 100px; height: 100px;
馃憖 Click here to see the correct answer and explanation
| Correct Answer | Explanation |
|---|---|
| B 馃帀 | Margin and Padding in percentages are calculated by the width of the parent element. |
Explanation based on 馃憠馃徏 Oh Hey, Padding Percentage is Based on the Parent Element鈥檚 Width
Considera el siguiente c贸digo:
| CSS | HTML |
|---|---|
![]() |
![]() |
驴 Cu谩l es el tama帽o del elemento baby ?
A. width: 200px; height: 100px;
B. width: 200px; height: 200px;
C. width: 100px; height: 100px;
馃憖 Haz click aqu铆 para ver la respuesta correcta y su explicaci贸n
| Respuesta correcta | Explicaci贸n |
|---|---|
| B 馃帀 | El margin y el padding en porcentajes se calculan por el width del elemento padre. |
Explicaci贸n basada en 馃憠馃徏 Oh Hey, Padding Percentage is Based on the Parent Element鈥檚 Width



Nunca us茅 el padding Las 100%, pero supongo que la opci贸n correcta es A, ya que tomar铆a el 100% de su contenedor padre