CSS类没有加载,但其他一切都是

时间:2017-12-10 19:36:20

标签: html css

我遇到类boxPad的问题,不想加载检查器面板中显示的所有其他类等,而不是boxPad为什么?

HTML:

<div class="infusion-holder yes boxPad">Some Info</div>

CSS:

.infusion-holder{display:none;}
.yes{display:block !important;}
.infusion-holder .yes .boxPad {padding-bottom:155px;}
.infusion-holder h3.ftitle{margin-bottom:10px !important;}
.infusion-holder form.infusion-form{border-top:1px solid #fff; padding-top:20px;}
.infusion-submit p{text-align:center; color:#fff; font-size:18px;}
.fdesc{padding-bottom:15px;}
.infusion-holder .infusion-submit input{margin-top:0px !important;}
.box1 form.infusion-form {display:inline-block; float:left; padding:0 15px 155px 0; border-top:none;}
.box2 form.infusion-form {display:inline-block; float:left; padding:0 15px 155px 0; border-top:none;}
.box3 form.infusion-form {display:inline-block; float:left; padding:0 15px 155px 0; border-top:none;}

标记: `          

    <div class="box1">
        <form class="infusion-form" action="#">
            <div class="infusion-submit">
                <p></p>
                <input type="submit" value="Download PDF" />
            </div>
        </form>
    </div>
    <div class="box2">
        <form class="infusion-form" action="#">
            <div class="infusion-submit">
                <p></p>
                <input type="submit" value="Download PDF" />
            </div>
        </form>
    </div>
    <div class="box3">
        <form class="infusion-form" action="#">
            <div class="infusion-submit">
                <p></p>
                <input type="submit" value="Download PDF" />
            </div>
        </form>
    </div>

`

1 个答案:

答案 0 :(得分:3)

Selector .infusion-holder .yes .boxPad {}正在元素中选择一个类boxPad的元素,其中元素yes位于元素infusion-holder内。

要选择包含所有三个类的元素(例如您的示例),您需要使用selector

.infusion-holder.yes.boxPad {}