1

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.

Tharaka Dilshan
  • 4,371
  • 3
  • 14
  • 28
C47
  • 639
  • 10
  • 19

1 Answers1

1

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.

nakov
  • 13,938
  • 12
  • 60
  • 110
  • try `color: red !important;` instead maybe the select2 library overrides the default one. – nakov May 02 '19 at 21:16
  • It does not work, I think it's because it's a `Select2` – C47 May 02 '19 at 21:43
  • you can either replace it in the select2 css file that comes with the library, or add an `id` attribute which takes precedence and put a style in your own css file. – nakov May 02 '19 at 21:46