Hammad Tariq
Hammad Tariq

Reputation: 1523

drop down menu padding in IE

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>

Thanks Slaks, 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?

P.S I am sorry, don't actually know the formating works in this rich editor but I think you will get the meaning, Albania is a country and then Tirana is the city in Albania so it should be indented in the dropdown for the user to figure out that Tirana is under Albania.

Thanks

Upvotes: 0

Views: 1209

Answers (1)

SLaks
SLaks

Reputation: 887423

I suspect that you're looking for the optgroup element.

Upvotes: 1

Related Questions