Reducing line height in angular material tree

荒凉一梦 提交于 2020-02-04 02:29:07

问题


I am using a angular tree material to display JSON data, I am unsatisfied by the amount of white spacing there is between lines. I have tried playing with mat-tree-node.line-height in the css with zero changes. How can I reduce all this vertical white space?


回答1:


Simply by overriding their css:

.mat-tree-node { min-height: 30px }



回答2:


The only working way I found with angular 8 on a nested element (and nested tree) is

.mat-tree-node {
  min-height: 1.2em !important;
  height: 1.2em;
}


来源:https://stackoverflow.com/questions/51483145/reducing-line-height-in-angular-material-tree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!