user2392276
user2392276

Reputation:

HTML Select menu dropdown: from right to left

I'm trying to make the HTML select menu's dropdown start from right and flow towards left. Just like the one here - http://www.flipkart.com/ But its not happening. Its currently starting from left and flowing towards right. And in IE, the dropdown menu is getting hidden.

Code -

<div class="search fr curves3">  
    <input class="main_search curves3" type="text" value="" placeholder="Search for items">
    <span style="border-left:1px solid #999; float:left;">
    <select>
        <option>All Categories</option>
        <option>Cat</option>
        <option>Dog</option>
        <option>Bird Categories Categories Categories</option>
        <option>Aquatics</option>
    </select>
    </span>
    <input type="submit" value="search" name="Search">
</div>     

CSS -

.search {
border:1px solid #999;
}
.search .main_search {
float:left;
padding: 7px 0 7px 5px;
border:0;
outline:none;
margin:0;
}
.search select {
float:left;
border:0;
outline:none;
padding: 7px 10px 7px 10px;
margin:0;
width:130px;
} 

JSfiddle - http://jsfiddle.net/generalsagar/gQxR7/

So how to make the dropdown start from right and then flow towards left? Thanks

Upvotes: 2

Views: 4551

Answers (1)

Sachin
Sachin

Reputation: 40970

use absolute positioning. Your css for search box will be something like this

.search {
    border:1px solid #999;
    position:absolute;
    right:0;
}

JS Fiddle Demo

Upvotes: 1

Related Questions