【问题标题】:Applying CSS to a class within Joomla Module将 CSS 应用于 Joomla 模块中的类
【发布时间】:2018-02-17 20:14:56
【问题描述】:

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

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

图像块的CSS:

.image-block {
    position: relative;
}

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

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

例如:

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

如果我使用类后缀,它会添加到模块类中并且不适用于图像块。

我怎样才能做到这一点?

【问题讨论】:

  • 阅读documentation
  • @Tijmen - 你在说哪个文档,Joomla?我读得很好。
  • 我说的是 Joomla 文档。特别是我链接到的页面,它准确地解释了您的要求。
  • 它解释了什么 - 我已经写在这里了。当您使用模块类后缀时,它适用于整个模块。不是该模块中的类。
  • 我的问题是如何修改类 img-block 而不是特定模块的 module-class。希望你能理解我的问题。

标签: php html css joomla


【解决方案1】:

按照@Tijmen 评论和 Joomla 文档,您可以添加页面类后缀,然后用作目标:

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

据我所知,如果您不想使用“整页”类后缀,Joomla 中的模块支持 Class Suffix to

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-05-18
    • 2015-11-14
    • 2018-10-07
    • 2016-06-23
    • 1970-01-01
    • 1970-01-01
    • 2019-03-24
    • 1970-01-01
    相关资源
    最近更新 更多