问题描述
我对Web开发非常陌生,尽管可能很容易,但我不知道如何解决以下问题.
I am very new to web development, and I cannot figure out how to solve the following issue, although it may be very easy.
我正在使用Angular 4和Angular Material来实现这样的工具提示:
I am using Angular 4 and Angular Material to implement tooltips like this:
<div mdTooltip="tooltip text" mdTooltipPosition="above">
<span>Show tooltip</span>
</div>
我想增大工具提示文本的字体大小.但是,我没有在Angular Material文档中找到如何执行此操作的方法,也没有在网上进行搜索.有人对如何执行此操作有任何想法吗?谢谢.
I would like to make the font size of the tooltip text bigger. However, I did not manage to find how to do this in the Angular Material documentation, neither searching in the web. Does anyone have any idea on how to do this? Thanks.
推荐答案
您可以通过在主样式文件中添加.mat-tooltip
css声明并在其中更改字体大小来解决此问题.您需要在字体大小上设置!important
,否则它将不会显示.
You can fix this by adding a .mat-tooltip
css declaration in you main styles file and change the font size there. You need to set !important
on the font size otherwise it won't show up.
这篇关于设置Angular Material工具提示的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!