DEV Community

Discussion on: Quick CSS Quiz #2

Collapse
 
equiman profile image
Camilo Martinez

Wrong answer: I choose 300px and 200px.

I thing it's the correct because box have no content.

Please explain why

Collapse
 
mredel profile image
MrEdel • Edited

Because padding is always calculated from the width.

Collapse
 
shadiqur3 profile image
shadiqur

i am also agree with @Camilo's answer.

Collapse
 
ismail9k profile image
Abdelrahman Ismail

Yes, this the behavior for percentage unite with padding property (even top and bottom padding) it always calculated relative to element's parent width.