1

I'm using DropKick to style a select field. I need to seperate the text in the option, so that one word is floated right.

I tried this, but my span is stripped away:

<select>
    <option>opt1</option>
    <option>opt2</option>
    <option>opt3<div class="right">I need to be to the right</div></option>
</select>

What can I do to target certain part of an option using DropKick?

JSW189
  • 6,267
  • 11
  • 44
  • 72

1 Answers1

0
  <select>
    <option>opt1</option>
    <option style="text-align: right;">opt2</option>
    <option>opt3<div class="right">I need to be to the right</div></option>
  </select>

By using the CSS text-align: right;

this what you mean?

Ugly alternative:

  <select>
    <option>opt1</option>
    <option>opt2</option>
    <option style="text-align: right;">Foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bar&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
  </select>

It will "more or less" make the letters in-between space bla ect, not even sure what to call this. :)

Daniel
  • 2,002
  • 5
  • 20
  • 32
  • What I need is for a line (option) in the dropdown to have the last word floated to the right. – user1872871 Dec 17 '12 at 23:39
  • If you want the text inside one option tag to be in left and right side with space in-between, not sure thats possible. – Daniel Dec 17 '12 at 23:42
  • Yes, that's what I need. Is it not possible to target a single word to make it red for instance? – user1872871 Dec 17 '12 at 23:45
  • http://stackoverflow.com/questions/3354979/styling-part-of-the-option-text they also talk about it here, it seems like you cant do what you are asking for. – Daniel Dec 17 '12 at 23:45
  • No you cant target a single word and make it red, bold and all these :) – Daniel Dec 17 '12 at 23:53