[英]how to center mat-list-item with mat-icon in mat-nav-list with Material 15.1.2
I am having trouble getting my anchor text and icon to look centered with Material 15.1.2我无法让我的锚文本和图标看起来以 Material 15.1.2 为中心
My layout looks like this:我的布局如下所示:
<mat-sidenav-container>
<mat-sidenav #sidenav role="navigation" [opened]="openSidenav">
<mat-nav-list>
<a mat-list-item routerLink="/signup">
<mat-icon>face</mat-icon>
<span matLine >Sign up</span>
</a>
The final result looks like:最终结果如下所示:
I think the newer version is using flex where before it was using block.我认为较新的版本在使用 block 之前使用 flex。 It also seems that the icon is 24px but the enclosing box is slightly bigger at 31px.
图标似乎也为 24px,但封闭框稍大一些,为 31px。
Trying to move the text with padding forces the whole block up and I can't move the anchor text up.尝试使用填充移动文本会强制整个块向上移动,我无法向上移动锚文本。
Any ideas?有任何想法吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.