更改PHP背景色为CSS通话 [英] Change a PHP background colour to a CSS call
本文介绍了更改PHP背景色为CSS通话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我没有codeR但我试图采取了相关的PHP文件的任何CSS,但需要一点帮助。
我如何重新写低于code从外部CSS,而不是PHP做这项工作取得的bgcolor
我只想波纹管改写为包括CSS类,而不是code actualy在进行颜色。
希望你明白我在说什么。
code的第一位。
$ bgcolour =($ķ%2)? BGCOLOR =#FFFEEE':'';
code第二位
'ROWCOLOUR'=> ($行['突出'] =='Y')? BGCOLOR =#fea100':$ bgcolour,
解决方案
CSS:
.fffeee {
背景色:#FFFEEE;
}.fea100 {
背景颜色:#FEA100;
}
PHP:
$ =的CssClass($ķ%2 == 0安培;&安培;!$行['突出'] ='Y')? fffeee':'fea100';ROWCOLOUR'=> 阶级='。$的CssClass。'',
I am no coder but am trying to take anything CSS related out of a php file but require a little help.
How can I re write the below code to get the bgcolor from an external CSS instead of the php doing the job
I just want the bellow rewriting to include the CSS class instead of the code actualy making the color.
Hope you understand what I am saying
first bit of code
$bgcolour = ($k % 2) ? 'bgcolor="#FFFEEE"' : '';
Second bit of code
'ROWCOLOUR' => ($row['highlighted'] == 'y') ? 'bgcolor="#fea100"' : $bgcolour,
解决方案
CSS:
.fffeee {
background-color: #FFFEEE;
}
.fea100 {
background-color: #FEA100;
}
PHP:
$cssClass = ($k % 2 == 0 && $row['highlighted'] != 'y') ? 'fffeee' : 'fea100';
'ROWCOLOUR' => 'class="' . $cssClass . '"',
这篇关于更改PHP背景色为CSS通话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文