一旦定位改变,就不能让div排队

时间:2014-01-07 16:15:19

标签: css css-position relative absolute

我试图让http://www.shabbatdinnerfilm.com/new/的三个社交分享按钮排成一行,我不确定他们为什么不这样做。第三个是div而不是a,相对定位,其中有一个绝对定位的div。

有什么想法吗? 谢谢大家!

3 个答案:

答案 0 :(得分:0)

.socialsharez .sharebutton代码的CSS选择器a中使用此代码:

.socialsharez .sharebutton {
   vertical-align:top;
}

答案 1 :(得分:0)

div标签是块元素,标签是内联元素。所以要让他们排队需要额外的css。我会为你的“注册”div添加顶级定位。

.socialsharez #signup {

  background-color: #383630;

  position: relative;

  top: 9px;

}

这应该有效,因为你已经给它相对定位。

答案 2 :(得分:-1)

是的,将vertical-align:top;.sharebutton一起使用或将top:9px#signup一起使用是正确的,但我不明白为什么你不使用{{1} }和float:leftdisplay:block

如果您这样做,请不要忘记最后.sharebutton clear

相关问题