我正在使用max-height
我的图像,但它仍然不适合该部分并且超出了范围。
我为顶层div
( 90vh
) 指定了一个固定大小,在它下面,我使用百分比来表示特定的相对高度。
结构看起来像
<div id="non-responsive-div"> <!-- height:95vh -->
<div id="top-level-container" class="three-row-grid-container"> <!-- max-height:100%; -->
<app-status-bar id="status-bar"></app-status-bar> <!--max-height:100%; -->
<app-nav-component id="menu-nav" ></app-nav-component><!-- grid child --> <!--max-height:100%; -->
<app-content-component id="content"></app-content-component><!-- grid child --> <!--max-height:100%; -->
</div>
<div>
<app-progress-bar></app-progress-bar><!-- not a grid child --> <!--this is positioned using absolute positioning and thus will not affect positions of others -->
<app-dialog-box #dialogBox [dialogMessage]="" [dialogID]="'appDialog'" [dialogContext]=""></app-dialog-box>
</div>
</div>
nav component
html
是_
<div id="logo-nav-div" class="logo-nav-style logo-nav-grid-container"> <!-- max-height:100%; -->
<div id="logo-nav-left" class="logo-nav-left-flexbox-container">
<img id="logo-image" src={{logofile}}> <!-- max-height:100%; -->
<button type="button" (click)="onGQClick()" [ngClass]="'unselected-button'">GQ</button>
<button type="button" (click)="onGTClick()" [ngClass]="'unselected-button'">GT</button>
<button type="button" (click)="onPClick()" [ngClass]="'unselected-button'">P</button>
</div>
<div id="logo-nav-right" class="logo-nav-right-flexbox-container">
<button type="button" (click)="onCQClick()" [ngClass]="'unselected-button'">CQ</button>
</div>
</div>
附件是大约。提琴手。我无法上传图片 - https://jsfiddle.net/01fj8hpz/
我的怀疑是问题可能出在flexbox
我将图像移出时flexbox
,图像似乎缩小了。但后来我无法将flexbox
内联与img
. 它位于单独的行中。