请查找更新的代码
<html>
<title>css</title>
<head>
<style>
#st {
z-index: -114;
margin-right: -80px;
}
</style>
</head>
State Code : <span><span id="st"></span>Maharashtra - MH</span>
</html>
我得到了以下输出,但我需要清晰的重叠文本
最佳答案
解决这个问题的唯一方法是使用 css display: none 或 visibility: hidden property ,两者都可以,我建议不显示。这是 CSS 和 HTML 隐藏数据的唯一方式。
<span>State Code: <span id="st"><span style="display: none">Maharashtra - </span>MH</span></span>
关于html - 如何使用CSS隐藏字符串中的一些文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47049437/