Issue
I have a drop down select menu, and I wanted to know if there is a way to control the way in which the options expand? The default seems to go either way and depends on how many items are in the list.
I would like to prevent the drop down options from displaying up and over the other form fields. When you select 'country' from the list, the menu expands downward (where I want it), but when you select an option from the 'state/region' field that has quite a few different choices (such as the UK) the menu expands up and over the other form fields, something I don't want. Anyway to fix this?
Here is my CSS ----->
#country {
position:relative;
background-image:url(../images/drop-down-selector.svg);
background-position:260px, center;
background-repeat:no-repeat;
-webkit-appearance:none;
-moz-appearance:none;
box-shadow:0px 0px 0px 1px #b5e7ff;
border:none;
outline:none;
left:2px;
width:292px;
height:47px;
font-size:1.5em;
font-family:'gotham-medium', arial, sans-serif;
src:url("http://www.3elementsreview.com/fonts/gotham-medium.otf");
color:#5fccff;
border-radius:0;
}
#state {
position:relative;
background-image:url(../images/drop-down-selector.svg);
background-position:260px, center;
background-repeat:no-repeat;
-webkit-appearance:none;
-moz-appearance:none;
box-shadow:0px 0px 0px 1px #b5e7ff;
border:none;
outline:none;
left:2px;
width:292px;
height:47px;
font-size:1.5em;
font-family:'gotham-medium', arial, sans-serif;
src:url("http://www.3elementsreview.com/fonts/gotham-medium.otf");
color:#5fccff;
border-radius:0;
}
Additional code ----->
<select name="Country" id="country">
<option value="">-Country-</option>
<option value="United States">United States</option>
<option value="United Kingdom">United Kingdom</option>
<option value="Canada">Canada</option>
<option value="Australia">Australia</option>
<option value="Brazil">Brazil</option>
<option value="France">France</option>
<option value="Italy">Italy</option>
<option value="New Zealand">New Zealand</option>
<option value="South Africa">South Africa</option>
</select>
Solution
You cannot control the drop down expansion direction. This is something the browser calculates. Perhaps you can try making some workaround. Make your own custom dropdown system? Maybe have a fake select box with a second dropdown positioned elsewhere. Or avoid your problem all together with some other solution.
related: How can I control the expansion direction of a drop-down list?
Answered By - jaredrada
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.