html - Do % in CSS flow into each other? -
i'm trying turn fixed site fluid site , have quick question on how %'s work.
<div class=wrap> <div class=box> <div class=text> <div class=box> <div=class=wrap> .wrap{ width: 100%; } .box{ width: 50% } .text{ width: 25% }
now given code happens? wrap fits entire screen. box fill 50% of screen, text fills 25% of 50%. doesn't fill 25% of entire screen, fills percentage of containing div. correct?
it's because div
calculating dimension it's parent
.
div having class .wrap
calculating it's dimension parent i.e body
that's why takes entire body width.
have in box model
Comments
Post a Comment