【发布时间】:2014-03-14 18:02:56
【问题描述】:
您会在下面看到带有浅蓝色背景的<a> 标签的打印屏幕。
如您所见,<a> 标签内的文本上下都有空格。
是否可以删除文本周围的空间?
亲切的问候
【问题讨论】:
-
请发布您的代码。
-
是的,这是可能的,但请先发布您的代码。
标签: html css vertical-alignment
您会在下面看到带有浅蓝色背景的<a> 标签的打印屏幕。
如您所见,<a> 标签内的文本上下都有空格。
是否可以删除文本周围的空间?
亲切的问候
【问题讨论】:
标签: html css vertical-alignment
你需要更小的行高。
【讨论】:
也许你可以...
选项 1:
a {
padding: 0; /* This will probably work A.F.A.I.K. */
display: inline-block;
/* If it doesn't, adding inline-block display will it inline **and** have
a CSS box... but I'm not sure if this is recommended, honestly. */
}
选项 2:
a {
line-height: 0;
/* Mess with the line-height value to change the
"Line Height" in an inline element */
}
【讨论】:
基本上<a> 标签没有这样的填充。告诉我,这个标签是否在任何 <li> 标签或其他任何东西中。
【讨论】: