我正在使用 Angular Material 选项卡。问题是标签的大小不一样。视内容而定。所以我想知道是否可以使内部 ng-scope
成为外部 ng-scope
的大小。
这是生成的 md-tab-content
的简化版本
<md-tab-content id="tab-content-3" class="_md ng-scope md-active">
<div class="ng-scope ng-isolate-scope">
</div>
</md-tab-content>
问题是我可以引用 Angular 元素吗?做一些像
md-tab-content > div.ng-scope {
and set size here = outside size?
//worst case set the height by hand
height: 252px;
}
此处div
内层高度为57,外层md-tab-content
为252
标签代码
<div id="tree-footer-container" ng-cloak>
<md-tabs id="jc" md-selected="selectedIndex">
<md-tab class="fullSize" ng-repeat="tab in tabs" ng-disabled="tab.disabled">
<md-tab-label>
<div style="float: left;padding-right: 10px;">{{tab.title}}</div>
</md-tab-label>
<md-tab-body>
<div flex style="background:blue" class="demo-tab tab{{$index%4}}" ng-include="tab.url">
</div>
</md-tab-body>
</md-tab>
</md-tabs>
</div>
最佳答案
尝试使用 Material 布局指令:
<md-tab-content id="..." layout="column" class="...">
<div flex class="...">
</div>
</md-tab-content>
关于javascript - 如何设置内部 div 的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39090295/