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; } 

demo of all


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -