【发布时间】:2015-03-11 15:17:56
【问题描述】:
我有一个按钮,旁边有一些文字。我想将文本的垂直对齐与按钮的对齐。这是我现在拥有的:
基本上,我希望or Sign Up 文本更高一点。我也在使用 MaterializeCSS。这是我的代码:
HTML
<div class="center">
<button class="btn waves-effect waves-green green darken-1">Sign In</button>
<span class="alternate-option">or <a href="#">Sign Up</a></span>
</div>
CSS
.alternate-option {
margin-left: 20px;
}
我尝试过使用padding-bottom 和margin-bottom。
【问题讨论】:
-
... 按钮的 CSS 在哪里?我们怎么知道高度等?
-
我认为您需要提供更多代码才能使我们能够复制图像。只要它们是
inline或inline-block,将vertical-align: middle;添加到button和span可能会起作用。
标签: html css alignment materialize