CSS-带下划线的文本,但忽略空格 [英] CSS - Underline text but ignore the spaces

查看:60
本文介绍了CSS-带下划线的文本,但忽略空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个链接的左边距为3px.这些链接带有下划线,如下所示:

 < a href ='#'>测试</a> 

不幸的是,链接内有空格,由于无法访问HTML代码,因此无法删除这些空格.这些空格也带有下划线,我不满意.有什么办法可以在不更改HTML的情况下将其删除?

以下是显示我的问题的小提琴:

PS: display:block 是冗余的",因为 float 通常已经将各个元素的显示属性设置为"block".但这没有害处...!

I have a couple of links that have a margin-left of 3px. These links are underlined and look like that:

<a href='#'>
    test
</a>

Unfortunately, there are spaces inside the link and I'm not able to remove these space since I don't have access to the HTML code. These spaces are also underlined, which I'm not happy with. Is there any way to remove them without changing the HTML?

Here is a fiddle that shows my problem: http://jsfiddle.net/e8quz/

Update:
Here is a picture, what I want it to look like:

解决方案

The spaces come from the line-breaks (well-known from the display:inline-block problematic).

So make your a elements display: block and float them to the left.

DEMO

PS: The display:block is "redundant", as float normally already sets the display property of the respective element to "block". But it do no harm ...!

这篇关于CSS-带下划线的文本,但忽略空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆