简体   繁体   English

字段集的CSS背景

[英]CSS background of a fieldset

At the website I'm currently working on I need to differentiate some elements by giving them background (color) so it's easier to see which one you're in. If I use the inspector from firefox, I can give the background without problem but when I pass that to my code I don't know why it does not work. 在我目前正在使用的网站上,我需要通过给它们一些背景(颜色)来区分某些元素,以便更轻松地查看您所处的元素。如果我使用firefox的检查器,则可以毫无问题地给出背景,但是当我将其传递给我的代码时,我不知道为什么它不起作用。 The class I'm using is this one: 我正在使用的课程是这样的:

<fieldset class="collapsible required-fields group-desc-programa field-group-fieldset form-wrapper collapse-processed">
</fieldset>

So what I add in my css style-sheet is the following: 因此,我在CSS样式表中添加的内容如下:

.collapsible.required-fields.group-desc-programa.field-group-fieldset.form-wrapper.collapse-processed.collapsed{
  background: red !important;
}

I think it has to be a really easy question because I normally do this kind of things without problem... 我认为这是一个非常简单的问题,因为我通常会毫无问题地进行此类操作...

Thanks for your time! 谢谢你的时间!

Your last class .collapsed is not necessary: 您上一堂课.collapsed不需要:

.collapsible.required-fields.group-desc-programa.field-group-fieldset.form-wrapper.collapse-processed {
  background: red !important;
}

Just add some , . 只需添加一些,

.collapsible, .required-fields, .group-desc-programa, .field-group-fieldset, .form-wrapper, .collapse-processed, .collapsed{
    background: red !important;
}

Use this css code 使用此CSS代码

.collapsible, .required-fields, .group-desc-programa, .field-group-fieldset, .form-wrapper, .collapse-processed, .collapsed{
background: red !important;
}

If you want to apply background color to the particular fieldset mentioned in question. 如果要将背景色应用于有问题的特定字段集。 Use id to apply background to it. 使用ID对其应用背景。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM