文本中div之间的间距?
这里有一个css小问题
代码:
printf( '<div id="replyto">Reply to</div>
<a class="replytolink" href="%1$s">%2$s %3$s</a>',
$parent_link, $parent->comment_author, $parent->comment_date );
css:
#replyto {
float: left;
}
.replytolink {
float: left;
}
是输出
回复“评论作者日期”
我怎样才能输出它
回复到“评论作者日期”,
文本和链接之间的间距是否正确?
Here is a little css problem
The code:
printf( '<div id="replyto">Reply to</div>
<a class="replytolink" href="%1$s">%2$s %3$s</a>',
$parent_link, $parent->comment_author, $parent->comment_date );
The css:
#replyto {
float: left;
}
.replytolink {
float: left;
}
is output
Reply to"Comment author Date"
How can I output it
Reply to "Comment author Date"
with correct spacing between text and link?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
从语义的角度来看,在这种情况下,使用浮动 div 后跟锚点并不是标签的最佳选择。
就我个人而言,我会将
div
替换为span
,然后您就不需要浮动它们,因此字间距将照常工作。From a semantic point of view, using a floating div followed by an anchor isn't the best choice possible of tags in this case.
Personally, I would replace that
div
with aspan
, then you wouldn't need to float them, and so word spacing would work as usual..试试这个:
示例:http://jsfiddle.net/RTFb7/
Try this:
Example: http://jsfiddle.net/RTFb7/
将
padding-right
添加到#replyto
:Add a
padding-right
to#replyto
:加个空格?
或者在
#replyto
上添加padding-right: 2em
。Add a space?
Or add
padding-right: 2em
on#replyto
.卢修斯的解决方案:
很简单。不需要 CSS。如果需要,请为
标记提供 ID。现在输出“回复”后的额外空格。
Solution by Lucius:
Neat. No CSS is required. Give the
<span>
tag an ID if needed. The extra blank space after "reply to " is now output.