Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Friday, December 11, 2015

CSS - How to make two divs in equal height within container without any script

To set two divs to equal height dynamically without any scripts use this code  

<div class="equal-height-container">
            <div class="equal-height-box">
                dynamic content goes here..
            </div>
            <div class ="equal-height-box">
                dynamic content goes here..
            </div>

   </div>



.equal-height-container {
    display: table;
}

.equal-height-box {
    display: table-cell;
    height: auto;
    overflow: hidden;
    float:none;
    vertical-align:top;
}

Wednesday, October 29, 2014

CSS - To display any content inside div to center


.parentDiv {
            text-align: center;
        }

.childDiv {
            display: inline-block;
            text-align: center;
            cursor: pointer;
           
        }


<div class="parentDiv">
   <div class="childDiv">put content</div>
   <div class="childDiv">put content</div>
   <div class="childDiv">put content</div>
</div>