html - CSS - div height -
i getting little gap between child-div , parent-div. possible child-div on parent-div height? or (the way around)possible if parent-div can scope height of child-div not overlap or spaces.
i have dom this:
<div class="parent-div"> <div class="parent-image"> </div> <div class="child-div"> </div> </div>
here css:
.parent-image:{ height:60px; } .parent-div{ border: 1px solid #e3e3e3; border-radius: 4px 4px 4px 4px; margin-bottom: 20px; width: 100%; } .child-div{ ???? }
if specify height: 100%;
take height of parent.
if child has padding, need change box-sizing.
.child { padding: 10px; box-sizing: border-box; }
if child has more content parent, either need tell scroll, or hide. note on browsers scroll-bar inside div, , on other browsers, it'll on outside.
.parent.c .child { overflow: auto; }
or
.parent.d .child { overflow: hidden; }
Comments
Post a Comment