Aravind
Aravind

Reputation: 3189

How to position the select element while using Chosen?

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>

Upvotes: 2

Views: 3076

Answers (2)

Praveen
Praveen

Reputation: 56509

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.

Upvotes: 1

user2404546
user2404546

Reputation:

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

     .chzn-choices{

left:25%;    
    }

Upvotes: 1

Related Questions