简体   繁体   English

删除或显示无 html 代码中的 static 文本 [重复]

[英]Remove or Display none static text in html code [duplicate]

I want to remove or set css property as display:none for the text element which has no html element or has no id or class attribute.对于没有 html 元素或没有 id 或 class 属性的文本元素,我想删除或设置 css 属性为display:none 在此处输入图像描述 Please check image for reference.请检查图像以供参考。

You can try font-size: 0 trick.您可以尝试font-size: 0技巧。

 div { font-size: 0; } div * { font-size: 1rem; }
 <div> <span>text 1</span> unwanted text <span>text 2</span> </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM