vertical align of some inline-block divs with different content

Posted by Jan Möller on Stack Overflow See other posts from Stack Overflow or by Jan Möller
Published on 2014-06-12T21:16:52Z Indexed on 2014/06/12 21:25 UTC
Read the original article Hit count: 248

i want to center some inline-block divs. I want to create a responsive design, so if the screen size is too small, the horizontal elements should be under each other.

How can i center them vertical, so they are side by side without a difference in height? (See fiddle).

Moveover those elements should be verticaly centered, if the screen size is too small.

http://jsfiddle.net/5dpRs/52/

CSS

.repeat
{
    display:inline-block;
    border-style:solid;
    border-width:2px;
    height:50px;
    width:50px;
}


#content
{   
    border-style:solid;
    border-width:2px;
    text-align:center;
}

HTML

<div id="content">
    <div class="repeat">
        <p>hello</p>       
    </div>
    <div class="repeat">
    </div>
</div>

Thank you :)

© Stack Overflow or respective owner

Related posts about html

Related posts about css