微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

html – 如何使用CSS中的空格引用长类名?

我正在尝试设计一些Drupal输出.特别是,我试图用一个超长的名字(包括空格)引用一个类.我不清楚这个的语法.原谅我,我是一个CSS新手.看到:
<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的属性.我以为会是这样的:

.node SOMETHING-HERE .header h2 { declaration; }

我不能仅仅引用节点,因为它被用于其他地方用于其他目的.我想要具体,只选择这个类:

class="node node-article node-teaser contextual-links-region node-even published with-comments node-teaser clearfix"

解决方法

使用点(.)可以组合多个类
.node.node-article.node-teaser.contextual-links-region.node-even.published.with-comments.node-teaser.clearfix {
 ...
}

原文地址:https://www.jb51.cc/html/231259.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐