I have a select html tag with country calling codes.
<select name="countryCallingCode" id="countryCallingCode">
<option value="1"><span class="name">Afghanistan</span><span class="code">+93</span></option>
<option value="2"><span class="name">Albania</span><span class="code">+355</span></option>
<option value="3"><span class="name">Algeria</span><span class="code">+213</span></option>
</select>
I want the name to be left aligned and the code to be right aligned. Presentation should look like:
Afghanistan +93
Albania +355
Algeria +213
I have introduced the span elements to achieve this with CSS.
select#countryCallingCode span.name {text-align: left;}
select#countryCallingCode span.code {text-align: right;}
Above code, is not working. Moreover, span elements seem to be not valid inside a html option tag for XHTML 1.0 strict.
Any idea?