应该如何定义 Angular Material 的固定弹性尺寸?
How should fixed flex sizes for Angular Material be defined?
我得到了以下标记
<div layout="column" layout-align="space-around center" ng-cloak>
<div flex="85">
<div layout="row" layout-align="space-around center">
<div flex>
<md-button class="md-fab md-warn" ui-sref="settings">
<ng-md-icon icon="settings" style="fill:white"></ng-md-icon>
</md-button>
<span class="md-subhead">Configuraciones</span>
</div>
<div flex>
<md-button class="md-fab md-primary" aria-label="Eat cake" ng-click="watch()">
<ng-md-icon icon="play_arrow" style="fill:white"></ng-md-icon>
</md-button>
</div>
</div>
</div>
<div flex="15">
<div layout="row" layout-align="space-around center">
<div flex>
<img src="public/img/buap-logo.png" class="img-rounded img-responsive center-block finalcut-img-small" style=""/>
</div>
<div flex>
<img src="public/img/lke-logo.jpg" class="img-rounded img-responsive center-block finalcut-img-small" style=""/>
</div>
</div>
</div>
</div>
生成以下内容:
但是我需要按钮 div 占其父容器高度的 85%,这就是我添加 flex="85"
属性的原因,而带有图像的 div 应该是 15高度的百分比。
我不确定我应该如何设置它们的属性来获得它。根据应该使它工作的文档。
Flex 仅适用于宽度。无法使用 flex 来判断 div 的高度。
属性 布局="column" 仅表示 div 从上到下显示,从左到右显示行。
来自material.angular.org
column: Items arranged vertically. max-width = 100% and max-height is the height of the items in the container.
您可以在 img 标签中使用 css 样式,例如 'height:15vh' 并试一试
我得到了以下标记
<div layout="column" layout-align="space-around center" ng-cloak>
<div flex="85">
<div layout="row" layout-align="space-around center">
<div flex>
<md-button class="md-fab md-warn" ui-sref="settings">
<ng-md-icon icon="settings" style="fill:white"></ng-md-icon>
</md-button>
<span class="md-subhead">Configuraciones</span>
</div>
<div flex>
<md-button class="md-fab md-primary" aria-label="Eat cake" ng-click="watch()">
<ng-md-icon icon="play_arrow" style="fill:white"></ng-md-icon>
</md-button>
</div>
</div>
</div>
<div flex="15">
<div layout="row" layout-align="space-around center">
<div flex>
<img src="public/img/buap-logo.png" class="img-rounded img-responsive center-block finalcut-img-small" style=""/>
</div>
<div flex>
<img src="public/img/lke-logo.jpg" class="img-rounded img-responsive center-block finalcut-img-small" style=""/>
</div>
</div>
</div>
</div>
生成以下内容:
但是我需要按钮 div 占其父容器高度的 85%,这就是我添加 flex="85"
属性的原因,而带有图像的 div 应该是 15高度的百分比。
我不确定我应该如何设置它们的属性来获得它。根据应该使它工作的文档。
Flex 仅适用于宽度。无法使用 flex 来判断 div 的高度。 属性 布局="column" 仅表示 div 从上到下显示,从左到右显示行。
来自material.angular.org
column: Items arranged vertically. max-width = 100% and max-height is the height of the items in the container.
您可以在 img 标签中使用 css 样式,例如 'height:15vh' 并试一试