因此,我有两个社交按钮,如下所示:
<span class="zocial facebook"><a href="#">Share on Facebook/a></span>
<span class="zocial twitter"><a href="#">Share on Twitter/a></span>
它们按照我的意愿并排显示,而不是并排显示。
CSS:
.zocial,
a.zocial {
border: 1px solid #777;
border-color: rgba(0,0,0,0.2);
border-bottom-color: #333;
border-bottom-color: rgba(0,0,0,0.4);
color: #fff;
-moz-box-shadow: inset 0 0.08em 0 rgba(255,255,255,0.4), inset 0 0 0.1em rgba(255,255,255,0.9);
-webkit-box-shadow: inset 0 0.08em 0 rgba(255,255,255,0.4), inset 0 0 0.1em rgba(255,255,255,0.9);
box-shadow: inset 0 0.08em 0 rgba(255,255,255,0.4), inset 0 0 0.1em rgba(255,255,255,0.9);
cursor: pointer;
display: inline-block;
font: bold 100%/2.1 "Lucida Grande", Tahoma, sans-serif;
padding: 0 .95em 0 0;
text-align: center;
text-decoration: none;
text-shadow: 0 1px 0 rgba(0,0,0,0.5);
white-space: nowrap;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
position: relative;
-moz-border-radius: .3em;
-webkit-border-radius: .3em;
border-radius: .3em;
}
.zocial:before {
content: "";
border-right: 0.075em solid rgba(0,0,0,0.1);
font: 120%/1.65 zocial;
font-style: normal;
font-weight: normal;
margin: 0 0.5em 0 0;
padding: 0 0.5em;
text-align: center;
text-decoration: none;
text-transform: none;
-moz-box-shadow: 0.075em 0 0 rgba(255,255,255,0.25);
-webkit-box-shadow: 0.075em 0 0 rgba(255,255,255,0.25);
box-shadow: 0.075em 0 0 rgba(255,255,255,0.25);
-moz-font-smoothing: antialiased;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;
}
.zocial:active {
outline: none; /* outline is visible on :focus */
}
最佳答案
对我来说很好,只是您没有正确关闭a
标记
Share on Facebook/a>
Share on Twitter/a>
JSFIDDLE
关于html - 如何获得按钮并排?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22132972/