阻止子 div 创建填充,但仅限于 css 中的一个 div id

发布于 2025-01-04 22:59:49 字数 1088 浏览 4 评论 0原文

我目前正在使用 Joomla 创建一个网站,但在某个模块应用填充时遇到问题。问题在于 Joomla 你有我似乎无法覆盖的模块类。布局如下:

    <div id="rt-page-surround">
    <div class="rt-container">
    <div class="rt-container-bg">
    <div id="rt-drawer">
    <div id="rt-header">
    <div class="rt-grid-6 rt-alpha">
    <div class="rt-grid-6 rt-omega">
    <div class="thumbnail_scroller">
    <div class="rt-block">
    <div class="module-content">
    <div id="jdv_iscroll122_wrap" class="jdv_iscroll_wrap " style="width: 620px; height: 110px; ">
    <div id="jdv_iscroll122_inner" class="jdv_iscroll_inner horizontally" style="width: 32766px; height: 110px; left: 0px; ">
    </div>

我试图修改的模块是thumbnail_scroller,问题是它从rt-block获取15px的填充。如果我将 rt-block 设置为 padding:0px 这会给thumbnail_scroller带来所需的效果,但它也会将零填充应用于页面上的其他所有内容,因为 rt-block 类与页面上的许多其他元素共享(这是方式该模板由作者编码)。我想要做的是将零填充应用于 rt-block,但仅适用于thumbnail_scroller 模块。

我已经尝试过

.thumbnail_scroller {padding:0px !important}

,但这似乎没有任何作用,有人对此有任何想法吗? :-)

I am using Joomla to create a website at the moment and I am having problems with a certain module getting padding applied to it. The problem is with Joomla you have classes for the modules that I cant seem to override. The layout is as follows :

    <div id="rt-page-surround">
    <div class="rt-container">
    <div class="rt-container-bg">
    <div id="rt-drawer">
    <div id="rt-header">
    <div class="rt-grid-6 rt-alpha">
    <div class="rt-grid-6 rt-omega">
    <div class="thumbnail_scroller">
    <div class="rt-block">
    <div class="module-content">
    <div id="jdv_iscroll122_wrap" class="jdv_iscroll_wrap " style="width: 620px; height: 110px; ">
    <div id="jdv_iscroll122_inner" class="jdv_iscroll_inner horizontally" style="width: 32766px; height: 110px; left: 0px; ">
    </div>

The module I am trying to modify is thumbnail_scroller, the problem is it is getting 15px of padding from rt-block. If I set rt-block to padding:0px this gives the desired affect to thumbnail_scroller but it also applies the zero padding to everything else on the page as the rt-block class is shared with numerous other elements on the page (this is the way the template is coded by the author). What I want to do is apply zero padding to rt-block but only for the thumbnail_scroller module.

I have tried

.thumbnail_scroller {padding:0px !important}

but this seems to do nothing, anyone any ideas on this one ? :-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凌乱心跳 2025-01-11 22:59:49
div.thumbnail_scroller div.rt-block {
    padding:0;
}

这专门针对具有 rt-block 类的 div,这些 div 位于具有thumbnail_scroller 类的 div 内。

div.thumbnail_scroller div.rt-block {
    padding:0;
}

This specifically targets divs with the rt-block class that are inside a div with the thumbnail_scroller class.

命硬 2025-01-11 22:59:49

您可以通过在 CSS 中尝试一些超特定的内容,例如:

div.thumbnail_scroller div.rt-block {

    padding: 0px;
}

该指令将仅适用于 thumbnail_scroller 类的 div(如果它位于 div< 中) /code> rt-block 类的容器。

(针对 div 订单进行编辑 - 重新阅读您的问题。){:Ø)

You can be hyper-specific by trying something within your CSS like:

div.thumbnail_scroller div.rt-block {

    padding: 0px;
}

That directive will then apply only to a div of class thumbnail_scroller IF it sits within a div container of class rt-block.

(Edited for div order - re-read your question.) {:¬)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文