C47
C47

Reputation: 661

How to change text color of item on select2

I need change text color of item on select2, I try this:

{!! FORM::label('IdOrigenRechazo', 'Origen de rechazo:') !!}
{!! FORM::select('IdOrigenRechazo',$origen->pluck('Descripcion','Id'),null,[
    'class'=>'select2_single form-control select-input',
    'placeholder'=>''
]) !!}

But, I don't know, how to change text color of item.

Note: Don't need background color.

Pls.

Upvotes: 1

Views: 614

Answers (1)

nakov
nakov

Reputation: 14288

The 4th parameter where you have an array of options, you can add a custom styling for your element, so if I understand your question right, you can do it like this:

{!! Form::select('IdOrigenRechazo',$origen->pluck('Descripcion','Id'),null,['class'=>'select2_single form-control select-input','placeholder'=>'', 'style' => 'color:red']) !!}

Notice the added style attribute in the options array. You can change the red for the color that you wish to use.

Upvotes: 1

Related Questions