如何在同一行上对齐搜索图标和自动完成组件

问题描述 投票:0回答:1

我在我的项目中使用自动完成组件,我在组件中添加了搜索图标作为后缀,如下图所示enter image description here

我试图将图标和自动完成组件的输入字段对齐在同一行上。

enter image description here

我无法做到这一点。这是分叉的stackblitz链接。

css angular angular-material
1个回答
1
投票

使用css:

mat-icon{
      position: relative;
    top: 7px;
}

见这里:https://stackblitz.com/edit/angular-9ao75y-wtqj1n?file=app/autocomplete-filter-example.css

© www.soinside.com 2019 - 2024. All rights reserved.