Reputation: 3444
I want to set height or width in selectbox .
<?php $subjectList=array('0'=>'Questions','1'=>'Feedback / Suggestions','2'=>'Location Owner Inquiry' ,'3'=>'Other');?>
<select name="vSubject" data-errormessage-value-missing="Select Reason!" id="vSubject" >
<option value="" >-Select One-</option>
<?php foreach($subjectList as $r=>$k) { ?>
<option value="<?php echo $r?>" ><?php echo $k?></option>
<?php }?>
</select>
Padding and height is not working in SAFARI. So suggest some solution.
Upvotes: 1
Views: 10272
Reputation: 6720
Did you try this CSS for your drop down?
overflow: hidden;
border: none;
outline: none;
-webkit-appearance: none;
For Safari you can try
-webkit-appearance: menulist-button;
so that width and height will work (link)
then you can use background,font-family,padding etc to further enchant your custom select tag. It worked for me in Safari/Chrome/FF ...
EDIT:
Editing option tag is not that easy. You can use the css below but everything is not customisable unfortunately
select option {
margin:40px;
background: rgba(0,0,0,0.3);
color:#fff;
text-shadow:0 1px 0 rgba(0,0,0,0.4);
}
Upvotes: 3
Reputation: 1037
Fiddle here Use a combination of text-indent and line-height to create the illusion of padding. Works in Safari.Should work in IE as well.
#vSubject {
text-indent:15px; line-height:28px;
}
Upvotes: 2
Reputation: 13988
try like this.
select {
width: 170px;
height: 25px;
-webkit-appearance: menulist-button;
}
Upvotes: 0