如何在 CSS 中引用带有空格的长类名? [英] How to reference a long class name with spaces in CSS?
本文介绍了如何在 CSS 中引用带有空格的长类名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试设计一些 Drupal 输出的样式.特别是,我试图引用一个具有超长名称(包括空格)的类.我不清楚这个的语法.原谅我,我是一个 CSS 新手.见:
I'm trying to style some Drupal output. In particular, I'm trying to reference a class with a super long name (that includes spaces). I'm unclear the syntax for this. Forgive me, I'm a CSS newbie. See:
<article id="node-38" class="node node-article node-teaser contextual-links-region node-even published with-comments node-teaser clearfix" about="/~actionin/node/38" typeof="sioc:Item foaf:Document">
<header>
<h2 property="dc:title" datatype=""><a href="/~actionin/node/38">National Nutrition Month: March 2012: "Get Your Plate in Shape"</a></h2>
我最终想引用 H2 属性.我在想它会是这样的:
I ultimately want to reference the H2 property. I was thinking it would be something like:
.node SOMETHING-HERE .header h2 { declaration; }
我不能只引用节点,因为它在其他地方用于其他目的.我想具体一点,只选择这个类:
I cannot just reference the node, since it is used elsewhere for other purposes. I want to be specific and select only this class:
class="node node-article node-teaser contextual-links-region node-even published with-comments node-teaser clearfix"
推荐答案
使用点 (.) 可以将多个类组合为一个组
Using dots (.) you can combine multiple class as a group
.node.node-article.node-teaser.contextual-links-region.node-even.published.with-comments.node-teaser.clearfix {
...
}
这篇关于如何在 CSS 中引用带有空格的长类名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文