top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is usage for min-height,max-height and height in css ?

0 votes
356 views

Am new to css.Some One Please provide examples for each ?

posted Jul 21, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

If you dont specify height, or you specify height by percetage but not giving its parenet a specify height, block element will resize to content height (0px for #two in this case).
So just set height to min-height, because DOM height will start from min-height without specifying height.

#one{
    background: red;
    min-height: 100px;
    height: 100px;
    max-height: 50%;
    padding: 10px;
}
answer Aug 4, 2014 by Deepak Negi
Similar Questions
+2 votes

Am new to css.I know only basics in css. I wonder what is the use clear:both.Please give some sample code for what is the use for this.

...