vendredi 17 avril 2015

CSS align part of select text to the right

This is what my HTML looks like:



<select>
<option>Long name <span>P1</span></option>
<option>Peter <span>P2</span></option>
<option>Hugo <span>K4</span></option>
</select>


I would like to display select options like this:



Longname P1
Petr P2
Hugo K4


codes (P1, P2, P4) aligned to the right side of select, conditions - I don't know length of longest name and I would prefer not to set exact width to any part of text


Aucun commentaire:

Enregistrer un commentaire