【发布时间】:2012-02-16 09:57:09
【问题描述】:
您好,我在 joomla 中遇到了一些 css 类的问题。我在一个模块中有两个 div,一个是包装器 class="wrapper",另一个是内容 class="content" 。内容在包装内。我想要做的是针对内容类的 css 样式。通常我只会将 .content {my style info} 放在样式表中,但问题是这个类在整个页面中多次使用。所以在后端,你可以为一个模块分配一个类名,所以我把这个命名为 .testimonials 。
为了不改变页面上的所有其他内容类,我试图通过放置以下内容来定位它:
.testimonials .content {my style info I am trying to apply}
但它不起作用,我知道你可以用 div 做到这一点,所以
#testimonials .content {my style info I am trying to apply}
但我的问题是这可以用类来完成吗?如果是这样的话,我正在尝试使用以下内容:
.testimonials .content {font-size:12px; width:300px !important;}
由于某种原因,内容没有换行,只是在段落末尾从页面上消失,所以我试图确保内容所在的第一级类没有重叠任何东西,奇怪的是偶数如果我修复 div 类,内容位于 50px 它仍然不会换行文本,所以我不确定我的目标是否正确?。
编辑>>>>>>>>>>..
Joomla 创建的 html 基本上是这样的 >>
<div class="wrapper">
<div class="content">SOME CONTENT</div>
</div>
然后它以良好的旧 Joomla 样式包装在一百万个其他 div 中。
我已经为模块提供了推荐类,所以它最终看起来像:
<div class="testimonials">
<div class="wrapper">
<div class="content">SOME CONTENT</div>
</div>
</div>
编辑 3 >>>>>> 好的,这就是它吐出来的东西
<div class="testimonials">
<div class="key4-block">
<div class="module-title"><h2 class="title">Client Testimonials</h2></div>
<div class="key4-module-inner">
<div class="module-content">
<script type="text/javascript">
RokStoriesImage['rokstories-184'].push('');
RokStoriesImage['rokstories-184'].push('');
RokStoriesImage['rokstories-184'].push('');
</script>
<div id="rokstories-184" class="rokstories-layout6 content-left" >
<div class="feature-block">
<div class="feature-wrapper">
<div class="feature-container">
<div class="feature-story">
<div class="image-full" style="float: right">
<img src="/sos/" alt="image" />
</div>
<div class="desc-container">
<div class="wrapper">
<span class="content"><p>Arrived in under 30 mins and got my pride and joy home in one piece, the day it conked out on me.</p>
<p>- Mr A Another</p></span>
</div>
</div>
</div>
<div class="feature-story">
<div class="image-full" style="float: right">
<img src="/sos/" alt="image" />
</div>
<div class="desc-container">
<div class="description">
<span class="feature-desc">
<p>Great Service ! , SOS came to the rescue me in no time at all and made my day.</p>
<p>- a customer</p>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
编辑 4 >>>>>>
这就是它正在做的事情
【问题讨论】:
-
好吧,在您显示相关的 HTML 标记之前,我们根本不知道您的目标是什么...
-
您好,这是不可能的,因为 html 是由 joomla 自己创建的,它是我试图更改的新闻提要模块中构建的一部分
-
所以?让它呈现一个页面,然后“查看源代码”并从源代码中复制/粘贴相关摘录。没有 something 可以看到,我们只是在黑暗中摸索,这对实际答案没有建设性,我将不得不投票结束,因为“不是一个真正的问题”。如果有机会真正帮助您,我宁愿不这样做。
-
好的,完成,内容类基本上是在进行,而不是换行,所以会从屏幕上消失,即使我将宽度固定为 300px,即它的父级有多大