当我在页面中添加图片时,我遇到了问题。像这张图片中选择的选项
这是我的代码
.html
<div class="container">
<img class="panjang" src="assets/imgs/cover_pln.png">
</div>
<mat-tab-group mat-stretch-tabs color="accent">
<mat-tab label="One" color="accent" >
<br>
<br>
<form class="example-form">
<mat-form-field class="example-full-width">
<input matInput placeholder="Test">
<mat-hint>Test</mat-hint>
</mat-form-field>
<br>
<br>
<mat-form-field class="example-full-width">
<input matInput placeholder="Test">
<mat-hint>Test</mat-hint>
</mat-form-field>
<br>
<br>
<mat-form-field class="example-full-width">
<input matInput placeholder="Test">
<mat-hint>Test</mat-hint>
</mat-form-field>
</form>
</mat-tab>
<mat-tab label="Two" color="accent">
<br>
<br>
<form class="example-form">
<mat-form-field class="example-full-width">
<input matInput placeholder="Test">
<mat-hint>Test</mat-hint>
</mat-form-field>
<br>
<br>
<mat-form-field class="example-full-width">
<input matInput placeholder="No.Ponsel">
<mat-hint>Test</mat-hint>
</mat-form-field>
<br>
<br>
<mat-form-field class="example-full-width">
<mat-select [(value)]="selected" placeholder="Test">
<mat-option >Test</mat-option>
<mat-option >Test</mat-option>
<mat-option >Test</mat-option>
<mat-option >Test</mat-option>
<mat-option >Test</mat-option>
<mat-option >Test</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field class="example-full-width">
<input matInput placeholder="Test">
<mat-hint>Test</mat-hint>
</mat-form-field>
</form>
</mat-tab>
</mat-tab-group>
.css
.mat-tab-label {
background-color: transparent;
color: #5c5c5c;
font-weight: 700;
}
/* Styles for the active tab label */
.mat-tab-label.mat-tab-label-active {
background-color: transparent;
color: #448AFF;
font-weight: 700;
}
.example-form {
min-width: 50%;
max-width: 100%;
width: 100%;
}
.example-full-width {
width: 100%;
margin-top:1%;
}
.mat-select{
margin-top: 1%;
position: bottom;
}
.panjang{
width:75%;
}
.container{
align-items: center;
text-align: center;
margin-left:1%;
margin-right:1%;
}
我正在使用 Angular 5 材料。有没有办法覆盖角材料中选择选项的默认位置?或者有没有其他解决这个问题的方法。谢谢
演示:https ://stackblitz.com/edit/angular-mat-select2-tjeqfz?file= app/select-hint-error-example.html 感谢 Yerkon