upog
upog

Reputation: 5531

Horizontal layout in HTML

I would like to place the label and comboBox horizontally aligned, but by default it is vertically aligned, please suggest

<div >              
    <label >Attribute:</label>
    <select>                    
        <option id="day" value="month">Day</option>
        <option id="week" value="week">Week</option>
        <option id="month" value="month">Month</option>                         
    </select>
</div>

Upvotes: 0

Views: 732

Answers (2)

V Setyawan
V Setyawan

Reputation: 86

By default it the display property will be set to block, you can try to change it to inline-block

label, select {
    display: inline-block;
}

Upvotes: 1

Phoenix
Phoenix

Reputation: 3212

Just add the following CSS:

div
{
    display: flex;
}

Here is the jsFiddle link: http://jsfiddle.net/PhoenixMobiplanet/d5634/

Upvotes: 1

Related Questions