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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -