Angular Material:如何更改 mat-grid-tile 的顶部填充 [英] Angular Material: How to change top padding of mat-grid-tile

查看:15
本文介绍了Angular Material:如何更改 mat-grid-tile 的顶部填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 angular-material 和 angular 5.mat-grid-tile 有它自己的顶部填充来计算使用 calc 方法.

am using angular-material with angular 5. mat-grid-tile has it's own top padding that calculates using calc method.

我想在 mat-grid-tile 上设置自定义填充.我该怎么做?

I want to set custom padding on mat-grid-tile. How can i do this?

推荐答案

grid tile 组件在元素本身上动态设置顶部填充,因此您需要在 CSS 中使用 !important 修饰符来覆盖它.

The grid tile component sets top padding dynamically on the element itself, so you need to use the !important modifier in your CSS to override it.

HTML:

<mat-grid-tile class="my-grid-tile"></mat-grid-tile>

CSS:

.my-grid-tile {
    padding-top: 24px !important;
}

这篇关于Angular Material:如何更改 mat-grid-tile 的顶部填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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