1

I wonder how to align the text (Div 1, Div 2) vertically the most effeicent way?

<div id="container">
    <div>Div 1</div>
    <div>Div 2</div>
</div>

#container > div
{
    display: inline-block;
    border: solid 1px #000;
    height: 300px;

}

#container
{
    border: solid 1px #ff0000;
    text-align: center;
    margin: 0px auto;
    width: 40%;

}

http://jsfiddle.net/gzkqx4rz/

showdev
  • 28,454
  • 37
  • 55
  • 73
Rossitten
  • 1,140
  • 1
  • 16
  • 34
  • 1
    What do you mean by efficient? Do you just want them vertically, or is there anything specific you'd like? Please elaborate (details/image would do) – A. Abramov Aug 19 '15 at 21:24
  • the easiest posisble way. with minimum amount of code. I know how to do taht with "display: table-cell" but I just want the most elegant solution. Of course I know the theme was countless times up. – Rossitten Aug 19 '15 at 21:34

0 Answers0