php - 在 PHP 中为 DIV 包含 CSS

标签 php css html

if(boothsizerGlobal ==  3){
    var cellWidth = 112;
    var cellHeight = 52;
    var innerDivElectricTop = 41; 
    var innerDivElectricLeft =  110;    
    $('.imgBox').css("background-image", "url(booth_top_images/5X20TOP.jpg)");
    $('.imgBox').css("width", "900px");
    $('.imgBox').css("height", "225px");
    sidewalls = 2;
    backwalls = 6;  

}

谁能帮我把上面的代码转换成 PHP? 我的意思是如果我有条件如何为超过40的DIV设置CSS?

谢谢

最佳答案

.imgBox
{
background:url(booth_top_images/5X20TOP.jpg) no-repeat; 
width:900px;
height:225px;
}

关于php - 在 PHP 中为 DIV 包含 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15831130/

相关文章:

图像中的 HTML 元素?

html - 添加填充后内容从容器中取出

html - 在 R Leaflet htmlwidget 上叠加静态图像

php - 在 Google GeoChart 中使用 PHP 处理从数据库中获取的数据

javascript - 根据php中的特定颜色突出显示数据

css - 使用类前缀创建 CSS 规则

css - WordPress字体跨浏览器问题

php - 使用过去 2 个月(日期)

php - 如何从 codeigniter 中的函数返回多个数组?

javascript - 在 React 中更改 <img> 标签上的 src 时图像加载滞后