【发布时间】:2017-10-07 10:22:26
【问题描述】:
在this page,我想在包含“ADSL 宽带 1”的灰色框上方添加一些文字。
我尝试使用以下 CSS 规则,但它不起作用:
.vc_tta-panels #adsl .vc_tta-panel-body:before {
content: 'text goes here';
}
你能看看这里有什么问题吗?
【问题讨论】:
标签: html css css-selectors pseudo-element
在this page,我想在包含“ADSL 宽带 1”的灰色框上方添加一些文字。
我尝试使用以下 CSS 规则,但它不起作用:
.vc_tta-panels #adsl .vc_tta-panel-body:before {
content: 'text goes here';
}
你能看看这里有什么问题吗?
【问题讨论】:
标签: html css css-selectors pseudo-element
您的其他规则覆盖此规则,您应该添加display 属性,例如:
.vc_tta-panels #adsl .vc_tta-panel-body:before {
content: 'text goes here';
display: inline;
}
【讨论】:
.vc_tta-panels #adsl .vc_tta-panel-body:before { content: 'text goes here'; display: block; line-height: 1.2; width: auto; height: auto; margin-bottom: 1em; }
margin-top: -15px。
【讨论】:
.vc_tta-panels #adsl .vc_tta-panel-body:before { content: 'text goes here'; display: block; line-height: 1.2; width: auto; height: auto; margin-bottom: 1em; }