gpt4 book ai didi

html - 等于按钮输入的高度?

转载 作者:行者123 更新时间:2023-12-04 03:56:45 25 4
gpt4 key购买 nike

我有这个 Html:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>

<div class="d-flex">
<div>
<input type="text" class="input-text">
<p class="error">error message</p>
</div>
<button class="cursor pl-4">apply coupon</button>
</div>

enter image description here

如果出现错误,按钮看起来像图片中的那样!

如何在输入错误的情况下使图像高度相等?

最佳答案

在相应的行上使用align-items: baseline,或者在相应的元素上使用align-self: baselineCodepen .

align-self-basline or align-items-baseline would be the responsible classes in Bootstrap.

.flex {
display: flex;
}

.reset {
align-items: baseline;
}
<div class="flex reset">
<div>
<input type="text">
<p>Error</p>
</div>
<button>Button</button>
</div>

关于html - 等于按钮输入的高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63726181/

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