我有第三方插件,我需要更改一个字。他们只允许我访问CSS:
<span class="apple">This is some words</span>
更改为:
<span class="apple">This is some text</span>
我如何用纯CSS做到这一点?
答案 0 :(得分:1)
如果您可以访问HTML,则可以隐藏不需要的文本的包装:
p.old-text-class { diplay: none;}
将新文本插入HTML中的相同位置:
<p class="new-text-class">This is some text</p>
答案 1 :(得分:1)
尝试使用带有内容的伪元素。
.apple {
visibility: hidden;
}
.apple:before {
content: "This is NEW text";
visibility: visible;
}
<span class="apple">This is OLD text</span>
答案 2 :(得分:1)
您可以尝试使用伪选择器:after
,
span{
position:relative;
color:transparent;
}
span:after{
content:'This is some text';
position:absolute;
right:10px;
color:#111;
}
&#13;
<span class="apple">This is some words</span>
&#13;