我有一个 Joomla 模块。 当我在 firebug 中检查 CSS 时,模块中有很多 div。 例如
<div class="moudle-class">
<div class="Image-block">
</div>
</div>
图像 block 的CSS:
.image-block {
position: relative;
}
这只是一个小例子,尽管 div 中有许多 div 都有自己的类。
我想为特定模块修改类 img-block
的 css,而不是跨所有模块。
例如:
.image-block {
position: relative;
float:left
}
如果我使用类后缀,则该后缀将添加到模块类并且不适用于图像 block 。
我怎样才能做到这一点?
最佳答案
按照@Tijmen 评论和 Joomla 文档,您可以添加页面类后缀,然后用作目标:
.myBlogClass .img-block {
/*your custom css here*/
}
据我所知,模块支持 Class Suffix to如果您不想使用“整页”类后缀,请在 Joomla 中使用。
.myNewModuleClass .img-block {
/*your custom css here*/
}
关于php - 将 CSS 应用于 Joomla 模块中的类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46124331/