forum

Home / DeveloperSection / Forums / How to vertically align the elements in two divs?

How to vertically align the elements in two divs?

Jayden Bell242105-Apr-2013
Hi Everyone!

<div id="div1">

    <label class="someClass1">Price 1</label>
    <label class="someClass1">Price 2</label> 
    <label class="someClass1">Price 3</label> 
    <label class="someClass1">Price 4</label> 
</div>
<div id="div2">
    <input type="text" class="someClass2"/>
    <input type="text" class="someClass2"/>
    <input type="text" class="someClass2"/>
    <input type="text" class="someClass2"/>
</div>
I have two divs. One div contains <label> elements and another div contains <input> elements. The two divs are aligned horizontally. I need to align the 

labels and input elements vertically so that each label has it's input underneath.

I may achieve the above requirement by putting the <label> and <input> elements by placing them in rows/columns. But I require them to using <div>.

Could someone help me out on this ?

Thanks in advance! 

Updated on 05-Apr-2013

Can you answer this question?


Answer

2 Answers

Liked By