在PHP中包含用于DIV的CSS
有人能帮我把上面的代码转换成PHP吗? 我的意思是,如果我有条件,如何在40多个DIV中设置CSS在PHP中包含用于DIV的CSS,php,css,html,Php,Css,Html,有人能帮我把上面的代码转换成PHP吗? 我的意思是,如果我有条件,如何在40多个DIV中设置CSS 谢谢好吧,您的原始代码一开始就毫无意义,因为一半声明的变量甚至没有被使用。此外,我也不明白为什么要将前端代码转换成这样的服务器端代码,php是而不是正确的方法 .imgBox { background:url(booth_top_images/5X20TOP.jpg) no-repeat; width:900px; height:225px; } if(bootshizerglobal==3)
谢谢好吧,您的原始代码一开始就毫无意义,因为一半声明的变量甚至没有被使用。此外,我也不明白为什么要将前端代码转换成这样的服务器端代码,
php
是而不是正确的方法
.imgBox
{
background:url(booth_top_images/5X20TOP.jpg) no-repeat;
width:900px;
height:225px;
}
if(bootshizerglobal==3){
$cellWidth='112px';
$cellHeight='52px';
$innerDivElectricTop='41px';
$innerDivElectricLeft='110px';
$backgroundImage='url(booth_top_images/5X20TOP.jpg)';
$divCode='将javascript转换为php?它们的工作方式都不同。服务器!=browser您没有使用cellWidth
或cellHeight
…如果您真的愿意,可以在javascript中使用-statement。比使用各种If
-语句更好…感谢它对me@Dhar没问题,很乐意帮忙。
.imgBox
{
background:url(booth_top_images/5X20TOP.jpg) no-repeat;
width:900px;
height:225px;
}
if(boothsizerGlobal == 3){
$cellWidth = '112px';
$cellHeight = '52px';
$innerDivElectricTop = '41px';
$innerDivElectricLeft = '110px';
$backgroundImage = 'url(booth_top_images/5X20TOP.jpg)';
$divCode = '<div style="width: ' . $cellWidth . '; height: ' . $cellHeight . '; "';
return $divCode
}