CSS:不能改变div中的css类

时间:2017-10-02 03:45:53

标签: css nested

我一直在研究这个问题大约45分钟,我确信答案非常简单,我只是没有得到它。我需要取出.content的宽度元素(宽度:760px)。但是,当我更改CSS(它是一个wordpress.com网站,这就是为什么我必须使用自定义程序而不能只通过编辑器执行此操作)时,它只是添加内容类而不会更改样式表。

这是样式表中的内容,该站点使用内容侧栏包装样式:

/* Wrapping div for .content and .sidebar-primary */

.content-sidebar-sidebar .content-sidebar-wrap,
.sidebar-content-sidebar .content-sidebar-wrap,
.sidebar-sidebar-content .content-sidebar-wrap {
    width: 930px;
}

.content-sidebar-sidebar .content-sidebar-wrap {
    float: left;
}

.sidebar-content-sidebar .content-sidebar-wrap,
.sidebar-sidebar-content .content-sidebar-wrap {
    float: right;
}

/* Content */

.content {
    background-color: #fff;
    border-radius: 3px;
    float: right;
    margin-bottom: 30px;
    padding: 40px;
    width: 760px;
}

1 个答案:

答案 0 :(得分:0)

因为它是wordpress.com网站,而不是wordpress.org,我们可以在“自定义网页”标签中更改CSS。

在“自定义网络”标签中,尝试输入:

.content {
    width: initial !important;
}

然后将取出760px的宽度。