hammadtariq Posted January 4, 2010 Share Posted January 4, 2010 Hello, I have checked this in IE8 and its compatible mode, in firefox this code is working fine but in IE its not indenting as expected. The code is below: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>blah blah</title> </head> <body> <select> <option style="padding-left: 0px;">Blah</option> <option style="padding-left: 5px;">Blah</option> <option style="padding-left: 10px;">Blah</option> <option style="padding-left: 0px;">Blah</option> <option style="padding-left: 5px;">Blah</option> </select> </body> </html> Please help! Quote Link to comment Share on other sites More sharing options...
vinpkl Posted January 5, 2010 Share Posted January 5, 2010 instead of using padding to indent them you should you optgroup. http://www.w3schools.com/tags/tag_optgroup.asp vineet Quote Link to comment Share on other sites More sharing options...
hammadtariq Posted January 6, 2010 Author Share Posted January 6, 2010 Hello, Thanks Vineet, this sounds promissing but optgroup is lacking the value attribute. Infact I have the region's drop down which goes like this: Albania Tirana United Kingdom London Pakistan India United States New York In this scenario user can also select United Kingdom for example and I dont want United Kingdom to be repeated twice. Is there any solution for it? Thanks Quote Link to comment Share on other sites More sharing options...
vinpkl Posted January 6, 2010 Share Posted January 6, 2010 this link may help you http://blog.christopherschultz.net/index.php/2009/02/10/indenting-html-select-options vineet Quote Link to comment Share on other sites More sharing options...
hammadtariq Posted January 6, 2010 Author Share Posted January 6, 2010 Thanks vineet for your help. I have introduced in <option> Tirana</option> and that somehow have fixed the thing. Thanks Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted January 7, 2010 Share Posted January 7, 2010 instead of using padding to indent them you should you optgroup. http://www.w3schools.com/tags/tag_optgroup.asp vineet You learn something new every day. Very helpful tip. thank you! Quote Link to comment Share on other sites More sharing options...
vinpkl Posted January 7, 2010 Share Posted January 7, 2010 you are welcome vineet Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.