2

I'm using inputs from this question: How do I use Chosen jQuery in my html file? So I have a select box, but the problem is I'm having trouble styling the select element.I used left and top % in CSS to position it, but it does not work.How can I position and style the select element?

http://jsfiddle.net/NWD9Q/3/

A little snippet:

<select class="chzn-select" multiple="true" name="faculty" style="width:200px;">
    <option value="AC">A</option>
    <option value="AD">B</option>
    <option value="AM">C</option>
    <option value="AP">D</option>
</select>
Community
  • 1
  • 1
Aravind
  • 3,169
  • 3
  • 23
  • 37

2 Answers2

1

Instead of trying to add css to the select, add to the wrapping ul , .chzn-choices

     .chzn-choices{

left:25%;    
    }
1

chzn-container will be the right class to add position and this can done in 2 ways.

  1. Adding the attribute directly in chosen.css file.
  2. Adding the attribute via jQuery as mentioned below.

$(".chzn-container").css({"left":"20%"});

DEMO in Jsfiddle.

Praveen
  • 55,303
  • 33
  • 133
  • 164