Date Added: 11/01/2016

Using  line-height 

CSS
/*code below will align center vertically */

height : 30px
line-height : 30px  

Using positon relative, absolute 

CSS

outer div  or container
position :relative

inside div
/* code below will allign inner div to right-bottom */
position :absolute
bottom:0; right:0;  

 

vertical centering

1 Display table 

 HTML
<div id="container">

    <div id="object">Content here</div>
</div>

CSS
#container {display: table;}
#object {
    display: table-cell;
    vertical-align: middle;
}

2- Equal top bottom left right

HTML
<div id="container">

    <div id="object">Content here</div>
</div>

CSS
#container {position: relative;}

#object {

position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 50%;
height: 30%;
margin: auto;
}

 

 

Last Update: Posted by: müslüm ÇEN

Not Commented Yet !
Please login in order to comment . Login

Related Content