删除链接和文本之间的空格和下划线
我已经剪切了,我想删除的链接和即将到来的文本之间的空间,但我不能想象我们的方法。我已尝试使用 padding
和 margin
,但没有效果。
I've this snipped for which I want to remove the space between the link and the upcoming text, but I can't figure our how to do it. I've tried using padding
and margin
, but nothing works.
HTML:
A <a href="#" style="letter-spacing: 1em;">link</a>. Some text.
输出:
以下是一个示例: http://codepen.io/anon/pen/gPQVXx
这个答案已经被接受了,我不建议使用它。它在一些浏览器中断,不会与屏幕阅读器兼容。除此之外,只是翻转字母也是不好的做法。我创建了这个答案来展示一些可能性,而不是一个好的解决方案。
这里是。
它需要一些额外的努力,但它的工作没有使用负边距或额外的html。
It does require some extra effort, but it works without the use of negative margins or extra html.
你基本上必须交换所有的字母,你很好去!
You basically have to swap all the letters around, and you're good to go!
这是因为使用了两个东西。 letter-direction
和:第一个字母
。
This works because of the use of two things. letter-direction
and :first-letter
.
a{
display: inline-block;
letter-spacing: 1em;
direction: rtl;
unicode-bidi: bidi-override;
}
a:first-letter{
letter-spacing: 0;
}
使用 last-letter
selector:)
This would've been much easier with a :last-letter
selector :)
希望这有助于