Php 如何将div背景色高亮显示为红色?
我在我的laravel应用程序中使用以下div,目前我有boarder风格,现在我需要红色adtype==1和其他绿色背景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
<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'}
我需要上面背景颜色代码的边框颜色我不明白你的问题,对不起,我的意思是我需要边框样式和背景颜色?