开发者

padding is not working in ie and safari [duplicate]

This question already has answers here: padding is not working in Safari and IE in select list (7 answers) 开发者_如何转开发 Closed 7 years ago.

I used a padding-left in selet list

<select style="padding-left:15px">
<option>male></option>
<option>female></option>
</select>

its working fine in FF but not in safari and ie

Then I have tried a text-indent in it

<select style="width:258px;text-indent:15px;">
<option>male></option>
<option>female></option>
</select>

Now its working fine in Safari and ie but its not working in FF, Please tell me is there any method which i can used to work it properly in all browser

Thanks


Might not seem the best solution, but put &nbsp; as much as you want before the option values.

<select>
<option>&nbsp;&nbsp; male></option>
<option>&nbsp;&nbsp; female></option>
</select>


If there's anybody out there who's still scratching their head over this, I hope this will help. I faced these problems recently and playing around with safari i found that safari does not like "padding-left:15px;" or anything else with a "-left or -right" for that matter. Also, found that replacing the "padding-left:15px;" with "padding:0 0 0 15px" seems to work.

This seems to a problem with older versions of mozilla too.

I hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜