Root
Root

Reputation: 35

How to highlight div background color as red?

I am using following div in my laravel app and currently I have boarder style now I need color background as red adtype ==1 and other green.

<div style="border-style: solid; 
            color: {{ $vehicule->adtype === 1 ? 'black' : 'blue' }} ">
    <img src="/images/{{ $upload->resized_name }}" height="150" width="250">
</div>

how can I do this?

Upvotes: 0

Views: 548

Answers (2)

Kamal Paliwal
Kamal Paliwal

Reputation: 1301

Use this code to change your background color:

<div style="border-style: solid; color: {{ $vehicule->adtype === 1 ? 'black' : 'blue' }}; background-color: {{ $vehicule->adtype === 1 ? 'red' : 'green' }}">
    <img src="/images/{{ $upload->resized_name }}" height="150" width="250"></a>
</div>

Upvotes: 0

nakov
nakov

Reputation: 14288

color is for the text, use background-color property.

background-color: {{ $vehicule->adtype === 1 ? 'red' : 'green' }}

Upvotes: 3

Related Questions