tags:

views:

138

answers:

1

Hi All,

Does any one know why my Safari is not taking padding in select lists? It's working fine in FF please tell me what to do. is there any issue with the doctype?

code:

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

I'm using the following doctype;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
A: 

Even though the W3 spec doesn't disallow padding in select boxes, for whatever reason webkit browsers (Safari, Chrome) don't support it. Instead, you can remove the padding-left and use text-indent instead, adding the same amount to your select box width.

From your example in your comment:

<select id="sexID" name="user[sex]" 
        style="border:1px solid #C1272D;
               width:258px; // 243 + 15px
               text-indent:15px;
               height:25px;
               color:#808080;">
mVChr
HI mvChr but its not working in firefox its working fine in ie and safari
Mayur
Well if you add both the text-indent and the padding-left back in then that should take care of it
mVChr
sorry i didn't get you, will you send me a sample code for it
Mayur