css - set max-width for select

Posted by Patrick on Stack Overflow See other posts from Stack Overflow or by Patrick
Published on 2010-04-07T11:00:16Z Indexed on 2010/04/07 11:03 UTC
Read the original article Hit count: 748

Filed under:
|

I have a form with a drop down list of venues and a submit button. They are supposed to be on the same line, but since the list of venues is dynamic, it could become too long and push the button down.

I was thinking of setting a max-width property to the select, but I'm not clear whether this will work in all browsers. Do you have any suggestions on a workaround?

form action="http://localhost/ci-llmg/index.php/welcome/searchVenueForm" method="post"     class="searchform"><select name="venue"> 
<option value="0" selected="selected">Select venue...</option> 
<option value="1">venue 0</option> 
<option value="2">club 1</option> 
<option value="3">disco 2</option> 
<option value="4">future test venue</option> 
</select>
<input type="submit" name="" value="Show venue!" class="submitButton"  />
</form>

css:

.searchform select {
max-width: 320px;
}

.searchform input.submitButton {
float: right;
}

© Stack Overflow or respective owner

Related posts about css

Related posts about css-hack