繁体   English   中英

我们如何将 mat-button 中的文本向左对齐?

[英]How do we align text within a mat-button to the left?

我们如何将 Angular 材料按钮中的文本左对齐?

这个答案建议text-align:left

我在这个演示中尝试过,但是没有爱......

https://stackblitz.com/edit/angular-ivy-lcnasu?file=src%2Fapp%2Fapp.component.html,src%2Fstyles.css,src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp. component.css,src%2Findex.html

想法?

因为.mdc-button使用了display: inline-flex; 你将不得不使用justify-content: flex-start; 将文本左对齐。

见下文:

<button style="width: 10rem; justify-content: flex-start;" mat-raised-button>Basic</button>

堆栈闪电战

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM