【发布时间】:2020-07-08 18:56:02
【问题描述】:
如何调整整个材质表单的大小?我希望表单域的大小与前面的 h3 文本大致相同。默认值似乎渲染得非常大。我尝试将size 和font size CSS 应用于mat-form-field 元素、mat-select 元素和mat-option 元素,但没有达到预期的效果。
settings.component.html
<mat-toolbar class="menu_bar" color="primary">
<h1>Configuration</h1>
</mat-toolbar>
<mat-toolbar class="top-container">
<span class="select">
<h3>Selected Object:</h3>
<mat-form-field appearance="outline">
<mat-select>
<mat-option value="object1">Object 1</mat-option>
<mat-option value="object2">Object 2</mat-option>
<mat-option value="object3">Object 3</mat-option>
</mat-select>
</mat-form-field>
</span>
</mat-toolbar>
settings.component.css
h1 {
font-size: 4vh;
font-weight: 600;
font-family: 'Open Sans', sans-serif;
}
body {
font-size: 2vh;
font-weight: 300;
color: lightgray;
font-family: 'Open Sans', sans-serif;
}
.menu_bar {
background-color: rgb(200, 213, 234);
color: black;
}
.select {
display:flex;
flex-flow: row;
justify-content: space-between;
}
.top-container {
height: fit-content;
display: flex;
flex-flow: row;
justify-content: space-between;
}
【问题讨论】:
标签: css angular angular-material