gpt4 book ai didi

html - 使用 materialize CSS 对齐按钮旁边的文本

转载 作者:行者123 更新时间:2023-11-28 04:52:46 31 4
gpt4 key购买 nike

我有一个按钮和它旁边的一些文本。我想将文本的垂直对齐方式与按钮的对齐方式相匹配。这是我现在拥有的:

enter image description here

基本上,我希望 或 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-bottommargin-bottom

最佳答案

这是由 MaterializeCSS 的按钮样式引起的:

margin-bottom: 15px;

Mousa Dirksz 的 span repositionning 的替代解决方案会是删除按钮的默认边距:

HTML

<div class="center">
<div class="alternate-option">
<button class="btn waves-effect waves-green green darken-1">Sign In</button>
<span>or <a href="#">Sign Up</a></span>
</div>
</div>

CSS

.alternate-option button {
margin-bottom: 0px;
}

.alternate-option span {
margin-left: 20px;
}

关于html - 使用 materialize CSS 对齐按钮旁边的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28990484/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com