设置 Angular Material Tooltip 的字体大小 [英] Set font size of Angular Material Tooltip

查看:37
本文介绍了设置 Angular Material Tooltip 的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Web 开发很陌生,我无法弄清楚如何解决以下问题,尽管它可能很容易.

我正在使用 Angular 4 和 Angular Material 来实现这样的工具提示:

<span>显示工具提示</span>

我想让工具提示文本的字体变大.但是,我没有在 Angular Material 文档中找到如何做到这一点,也没有在网上搜索.有没有人知道如何做到这一点?谢谢.

解决方案

您可以通过在主样式文件中添加 .mat-tooltip css 声明并更改其中的字体大小来解决此问题.您需要在字体大小上设置 !important 否则它不会显示.

I am very new to web development, and I cannot figure out how to solve the following issue, although it may be very easy.

I am using Angular 4 and Angular Material to implement tooltips like this:

<div mdTooltip="tooltip text" mdTooltipPosition="above">
  <span>Show tooltip</span>
</div>

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.

解决方案

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 Tooltip 的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆