Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何将div背景色高亮显示为红色?_Php_Css_Laravel - Fatal编程技术网

Php 如何将div背景色高亮显示为红色?

Php 如何将div背景色高亮显示为红色?,php,css,laravel,Php,Css,Laravel,我在我的laravel应用程序中使用以下div,目前我有boarder风格,现在我需要红色adtype==1和其他绿色背景 <div style="border-style: solid; color: {{ $vehicule->adtype === 1 ? 'black' : 'blue' }} "> <img src="/images/{{ $upload->resized_name }}" height="150" widt

我在我的laravel应用程序中使用以下div,目前我有boarder风格,现在我需要红色adtype==1和其他绿色背景

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

已调整大小的\u name}“height=“150”width=“250”>

如何执行此操作?

color
用于文本,请使用
背景色
属性

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

color
用于文本,请使用
background color
属性

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

使用以下代码更改背景颜色:

<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>

已调整大小的\u name}“height=“150”width=“250”>

使用此代码更改背景颜色:

<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>

已调整大小的\u name}“height=“150”width=“250”>

还有一件事,那就是如何将边框颜色更改为===1白色和其他粉红色?
边框颜色:{{{$vehicle->adtype==1?'white':'pink'}
我需要带以上背景颜色代码的边框颜色我不明白你的问题,对不起,我的意思是我需要边框样式和背景颜色?还有一件事,那就是如何将边框颜色更改为===1白色和其他粉色?
边框颜色:{{$vehicle->adtype==1?'white':'pink'}
我需要上面背景颜色代码的边框颜色我不明白你的问题,对不起,我的意思是我需要边框样式和背景颜色?