2017-05-09 87 views
1

this page,我想在包含“ADSL宽带1”的灰色框的上方添加一些文本。:伪类不工作之前

enter image description here

我使用下面的CSS规则试过,但它不工作:

.vc_tta-panels #adsl .vc_tta-panel-body:before { 
    content: 'text goes here'; 
} 

你能看到这里有什么问题吗?

回答

1

你的其他规则重写这个规则,你应该添加display属性,例如:

.vc_tta-panels #adsl .vc_tta-panel-body:before { 
    content: 'text goes here'; 
    display: inline; 
} 
+1

谢谢谢尔盖。我无法在黑灰色框之前显示文本。我试过'.vc_tta-panels #adsl .vc_tta-panel-body:before {content:'text goes here';显示:块;行高:1.2;宽度:自动;身高:自动; margin-bottom:1em; }' – Steve

+0

@例如,您可以添加'margin-top:-15px'。 –

1

你写的是做工精细的代码,但在同一时间,它越来越通过写你的CSS隐藏一些其他的地方。

vc_tta-panels #adsl .vc_tta-panel-body:before { 
    content: 'Hello'; 
    display: block !important; 
    } 

附加问题的快照,从那里获取隐藏由于给出display:noneenter image description here

+0

我无法在黑灰色框之前显示文字。我试过'.vc_tta-panels #adsl .vc_tta-panel-body:在{ \t content:'text goes here'; \t display:block; \t line-height:1.2; \t宽度:自动; \t身高:自动; \t margin-bottom:1em; }' – Steve