如何在 PHP echo 中添加样式 CSS 背景颜色?

请帮助我......我想为 PHP echo 添加背景颜色


我的脚本:


<div class="container">

    <input name='kursi[]' value='A1' id='A1' onclick='cer(this)' 

    autocomplete='off' type='checkbox' 

    <?php if(in_array(array('no_kursi_order' => 'A1'), $kursi))

      <!-- How to add style background-color here --> 

      {echo "disabled checked";

    } ?>>

    

    <label class='checkmark' for='A1'>A1</label>

</div>


子衿沉夜
浏览 85回答 1
1回答

慕森王

尝试这个&nbsp; &nbsp; <div class="container">&nbsp; &nbsp; &nbsp; &nbsp; <input name='kursi[]' value='A1' id='A1' onclick='cer(this)'&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; autocomplete='off' type='checkbox'&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <?php if(in_array(array('no_kursi_order' => 'A1'), $kursi))&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <!-- How to add style background-color here -->&nbsp;-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {echo "disabled checked";+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {echo "disabled checked style=\"background-color: red;\"";&nbsp; &nbsp; &nbsp; &nbsp; } ?>>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <label class='checkmark' for='A1'>A1</label>&nbsp; &nbsp; </div>
打开App,查看更多内容
随时随地看视频慕课网APP