gpt4 book ai didi

html - Angular Material md-input-container 不会垂直居中

转载 作者:太空宇宙 更新时间:2023-11-04 13:40:24 26 4
gpt4 key购买 nike

我正在使用 angular material用于设计我的元素。现在我想要在我的工具栏中进行搜索的输入,就像 youtube 一样。

我的代码:

<md-list flex-offset="10">
<md-list-item layout-align="start center">
<md-input-container md-no-float flex>
<input type="text" placeholder="Search" flex>
</md-input-container>
<md-button> test </md-button>
</md-list-item>
</md-list>

我的 md-list 之前的工具栏标签如下所示:

<md-toolbar layout="row" flex style="max-height: 60px;">
<div class="md-toolbar-tools">

我尝试过的:

  • 将它包裹在一个普通的 div 中,并将布局对齐设置为开始、居中。
  • 使用表单标签包装输入容器。

问题:

输入组不会垂直居中,这就是我所追求的。我尝试过的所有其他指令都像 md 按钮一样完美地居中。

这是错误还是我做错了什么?

编辑(添加图片比较、md-input-container、input、md-button):

enter image description here

最佳答案

你试过吗

md-input-container .md-errors-spacer{
min-height: 0px !important;
}

关于html - Angular Material md-input-container 不会垂直居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35796728/

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