如果我们在任何html元素上给出text-indent属性,那么为什么它还要更改该元素的:before选择器的位置?
在这里,我想隐藏锚标记值,但不想要a:before',这在css中是可能的吗,如果是,那么怎么做?
<a>Hello</a>
a{
text-indent:-9999px;
display:block;
}
a:before{
content:"before";
text-indent:0;
display:inline-block;
}发布于 2015-05-18 13:45:59
我只能想到这个
a {
text-indent: -9999px;
display: inline-block; /* feels better - depends on your requirement*/
}
a:before {
content: "before";
text-indent: 0;
display: inline-block;
position: relative;
left: 9999px;
}<a>Hello</a>
https://stackoverflow.com/questions/30304800
复制相似问题