将CSS应用于Joomla模块中的类

时间:2017-09-08 20:50:12

标签: php html css joomla

我有一个Joomla模块。 当我在firebug中检查CSS时,模块中有很多div。 例如

<div class="moudle-class">
<div class="Image-block">
</div>
</div>

图像块的Css:

.image-block {
    position: relative;
}

这只是一个小例子,尽管div中有很多div都有自己的类。

我想为特定模块修改类img-block的css,而不是修改所有模块的css。

例如:

.image-block {
position: relative;
float:left
}

如果我使用类后缀,则会将其添加到模块类中,但不适用于图像块。

我怎么能做到这一点?

1 个答案:

答案 0 :(得分:0)

关注@Tijmen评论和Joomla文档后,您可以添加Page Class Suffix然后用作目标:

.myBlogClass .img-block {
  /*your custom css here*/
}

如果您不想使用“整页”类后缀,我可以记住Joomla中的模块支持Class Suffix to

.myNewModuleClass .img-block {
  /*your custom css here*/
}