我在我的博客上安装 ShareThis 插件已经有一段时间了,但我只是注意到并不是我所有的“分享图标”都以内嵌方式显示。
我尝试过使用 padding-bottom 和 margin-bottom,但这并没有达到我希望的效果。
你们中的任何人都可以阐明我做错了什么吗?
代码片段:
<div style= "display: inline; float: left; padding-left: 4px; padding-bottom: 4px;">
<span st_url='{Permalink}' st_title='{Title}' class='st_fblike' displayText='Facebook Like'></span>
<span st_url='{Permalink}' st_title='{Title}' class='st_twitter' </span>
<span st_url='{Permalink}' st_title='{Title}' class='st_email'></span>
</div>
请注意,在预览窗口中,图标保持内联。很奇怪。
最佳答案
在您的脚本中替换此 CSS 类。
.stButton {
position: relative;
z-index: 1;
text-decoration: none;
color: black;
display: inline-block;
cursor: pointer;
margin-right: 3px;
margin-left: 3px;
font-size: 11px;
line-height: 26px;
}
如您所见,我已将 line-height 更改为 26px,现在它可以正确适应了。
关于html - <span> 在使用 ShareThis 时不保持内联,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16366472/