html a target css,html - Target a css class inside another css class - Stack Overflow

博主在Joomla中遇到CSS类选择器的问题,尝试针对.module类内的.content类应用特定样式,但未能成功。已尝试使用.testimonials.content作为选择器,以避免影响页面上其他.content类元素,但样式未生效。内容区域出现布局问题,不按预期包裹文本。问题可能与模块类名的使用或嵌套结构有关。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Hi I am having problems with some css classes in joomla. I have two divs in a module, one is the wrapper class="wrapper", the other is the content class="content" . Content is inside wrapper. What I am trying to do is target a css style on the content class. Usually I would just put .content {my style info} in the style sheet, but the problem is that this class is used several times throughout the page. So in the backend, you can assign a module a class name, so I have called this one .testimonials .

So that I dont alter all the other content classes on the page I am trying to target it by putting this :

.testimonials .content {my style info I am trying to apply}

but it is not working, I know you can do this with divs, so

#testimonials .content {my style info I am trying to apply}

but my question is can this be done with classes ?, if so something is going wrong as I am trying to use the following :

.testimonials .content {font-size:12px; width:300px !important;}

as for some reason the content is not wrapping and just vanishes off the page at the end of the paragraph, so I am trying to make sure the 1st level class the content is sitting is not overlapping anything, the odd thing is even if I fix the div class the content sits in to 50px it still wont wrap the text, so I am not sure if I am targeting it right ?.

edit >>>>>>>>>>..

The html Joomla is creating basically looks like this >>

SOME CONTENT

then it is wrapped in a million other divs in the good old Joomla style.

I have given the module the class of testimonials, so it ends up looking something like :

SOME CONTENT

EDIT 3 >>>>>>>

OK, this is what it is spitting out

Client Testimonials

RokStoriesImage['rokstories-184'].push('');

RokStoriesImage['rokstories-184'].push('');

RokStoriesImage['rokstories-184'].push('');

image

Arrived in under 30 mins and got my pride and joy home in one piece, the day it conked out on me.

- Mr A Another

image

Great Service ! , SOS came to the rescue me in no time at all and made my day.

- a customer

EDIT 4 >>>>>>

This is what it is doing

dflkT.gif

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值