h2内嵌css样式,CSS样式 - 在类中编辑H2(CSS Styles - Editing H2 within classes)

在CSS中,要编辑具有特定类的H2元素内容,可以使用`.box`选择器,并设置`content: "TEXT HERE";`。如果需要更具体的定位,可以使用如`header > li > .box`这样的层级选择器。确保避免ID冲突,如果存在多个相同类名,考虑使用ID或更具体的选择器。

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

CSS样式 - 在类中编辑H2(CSS Styles - Editing H2 within classes)

我希望在另一个类块中编辑H2类的内容,但却努力使其工作。

这是班级列表

Live Now - Podcasts

我正在尝试编辑H2的内容,其中包含“Live Now - Podcasts”,但没有运气

我尝试了很多无用的东西,我尝试的最后一件事就是

#mainHeader li#xyz_insert_html_widget-2.widget-1.widget-first.widget-last.widget-odd.widget.widget_xyz_insert_html_widget h2.box

使用内容属性content: "TEXT HERE";

任何指导我正确方向的帮助表示赞赏!

I'm looking to edit the content of a H2 class within another block of classes but struggling to make it work.

Here is the class list

Live Now - Podcasts

I'm trying to edit the content of the H2 which contains "Live Now - Podcasts" with no luck

I've tried a lot of things with no avail, the last thing I tried was

#mainHeader li#xyz_insert_html_widget-2.widget-1.widget-first.widget-last.widget-odd.widget.widget_xyz_insert_html_widget h2.box

Using the content property content: "TEXT HERE";

Any help in pointing me in the right direction is appreciated!

原文:https://stackoverflow.com/questions/37668541

更新时间:2020-09-08 11:09

最满意答案

尝试

.box{

content: "TEXT HERE";

}

这是因为使用css,您可以引用您希望应用属性的特定元素类名称,除非您在文档的其他区域中具有这些名称。 在这种情况下,要么为它分配一个id,以便像这样引用它:

#exampleid{

content: "TEXT HERE";

}

或遵循您的界限,具体情况:

header > li > .box {

content: "TEXT HERE";

}

Try

.box{

content: "TEXT HERE";

}

This because with css you can just reference the specific element class name that you want your properties to apply unless you have those on other area of your documents. In that case either assign an id to it so to reference it like this:

#exampleid{

content: "TEXT HERE";

}

or following your line, being case specific:

header > li > .box {

content: "TEXT HERE";

}

相关问答

在你的第二个小提琴中,你的.cont_title类上面有一组无效的字符。 删除无效字符可以解决您遇到的问题。 ...

.row:hover .remove{

opacity: 1;

}​ &t;-- Some weird characters here

.cont_title {

height: 40px;

...

In your second fiddle, you have an invalid set of characters just above yo

...

检查你的seetings.py , STATIC_URL似乎被定义错了。 查看文档: https : //docs.djangoproject.com/en/dev/ref/settings/#std : setting-STATIC_URL New to style sheets. I forgot to include following style sheet entries in base.html then it worked. Although the file date picker

...

尝试 .box{

content: "TEXT HERE";

}

这是因为使用css,您可以引用您希望应用属性的特定元素类名称,除非您在文档的其他区域中具有这些名称。 在这种情况下,要么为它分配一个id,以便像这样引用它: #exampleid{

content: "TEXT HERE";

}

或遵循您的界限,具体情况: header > li > .box {

content: "TEXT HERE";

}

Try .box{

content: "TEXT HE

...

正如你所说的那样if .$item['itemImageTitle'] & .$item['itemTitle'] empty show just the image 。 你可以试试这个

" id="<?php echo "slider-wrapper-".$bID; ?>">

...

h2 { margin-top: 5px ) //replace 5 with whatever you want

h2 { margin-top: 5px ) //replace 5 with whatever you want

.cnt h2, .cnt h3, .cnt h4, .cnt h5, .cnt h6 {

font-size:16px;

font-weight:700;

}

阅读css特异性 .cnt h2, .cnt h3, .cnt h4, .cnt h5, .cnt h6 {

font-size:16px;

font-weight:700;

}

read up on css specificity

有一种方法可以实现,但只有支持CSS3的浏览器才能实现:不是伪类。 h2[class] {

/* Styles for

with a class, regardless of the value */

}

h2:not([class]) {

/* Styles for

without classes */

}

我希望它有效! [编辑]我在这里为你做了一个简单的演示 - http://jsfiddle.net/fL2sT/ There is a method t

...

快速而肮脏的方法是将你的css包含在ckeditor css中: 你/ckeditor/content.css应该从: @import "/css/boostrap.css"; /*your site css*/

...

请注意,文件中的其他内容将覆盖您的某些css声明,因此请相应删除它们 content.css是您在编辑期间自定义ckeditor如何显示其内容所需的内容。 the fast and dirty way is to include your css in the ckedito

...

听起来你想在第一个h2之后缩进所有兄弟姐妹,除了其他的h2s,在这种情况下,这应该做的工作: h2 ~ *:not(h2) {

margin-left: 10px;

}

查看一般兄弟组合子和否定伪类以及jsbin上的现场演示 。 It sounds like you want to indent all siblings after the first h2 except other h2s, in which case this should do the job: h2 ~ *:no

...

正确的格式是将整个短语包装在

标签中,就像这样

Company Name

The proper format is to wrap the entire phrase inside your

tag like so

Company Name

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值