1

我必须承认,我希望这能奏效。在我看来,我认为我的 CSS 类选择了“h2一个元素的所有子元素,包含class="jumbotron-features"

jsFiddle:http: //jsfiddle.net/sKAhn/

CSS

.jumbotron-features h2
{
    color: #797979;
    font-style: oblique;
}

HTML

<div class="jumbotron jumbtron-features">
        <div class="container">
            <div class="content">
                <div class="row">
                    <div class="col-lg-4 text-left">
                        <div class="feature-box feature-box-vertical-middle">
                            <h2>Seriously powerful, incredibly intuitive, and designed by real estate experts!</h2>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
4

7 回答 7

2

您的 div 类被称为jumbtron-features,而不是jumbotron-features

于 2013-09-30T02:53:00.987 回答
2

拼写错误,类名中的拼写错误

替换这个

.jumbotron-features h2

.jumbtron-features h2

工作作风:

<style>
.jumbtron-features h2{
    color: #797979;
    font-style: oblique;
}
</style>

HTML:

<div class="jumbotron jumbtron-features">
        <div class="container">
            <div class="content">
                <div class="row">
                    <div class="col-lg-4 text-left">
                        <div class="feature-box feature-box-vertical-middle">
                            <h2>Seriously powerful, incredibly intuitive, and designed by real estate experts!</h2>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

输出:

在此处输入图像描述

于 2013-09-30T02:55:55.300 回答
2

HTML 应该是这样的:

 <div class="jumbotron jumbotron-features">
            <div class="container">
                <div class="content">
                    <div class="row">
                        <div class="col-lg-4 text-left">
                            <div class="feature-box feature-box-vertical-middle">
                                <h2>Seriously powerful, incredibly intuitive, and designed by real estate experts!</h2>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

这是因为您在 HTML 中拼错了类名

于 2013-09-30T02:57:42.303 回答
1

HTML 中的类:jumbtron-features

CSS中的类:jumbotron-features

' o ' 的区别。

于 2013-09-30T02:53:03.897 回答
1

你会很生气的。你的div类是jumbtron-features,你的 CSS 类是jumbOtron-features. 注意,' O '。

于 2013-09-30T02:53:16.197 回答
1

你的代码有错误。

CSS 有jumbotron-features ,HTML 有jumbtron-features

这有效:http: //jsfiddle.net/sKAhn/2/

于 2013-09-30T02:53:51.073 回答
1

你的班级名称应该是这样的:

<div class="jumbtron-features">
    <div class="container">
        <div class="content">
            <div class="row">
                <div class="col-lg-4 text-left">
                    <div class="feature-box feature-box-vertical-middle">
                        <h2>Seriously powerful, incredibly intuitive, and designed by real estate experts!</h2>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
于 2013-09-30T02:54:50.873 回答