我採用了棱角分明2.創建一個表單當我的屬性required
添加到我的<input>
我得到這個:禁用MD-輸入驗證集裝箱角2
我要的只是第二紅色保證金, input
標記中的一個,而不是屬於md-input-container
的第一個邊距。
是否有辦法禁用這些邊距之一?
的html代碼:
<h2 class="mmm">Create building</h2>
<form #buildingForm="ngForm" (ngSubmit)="onSubmit(buildingForm.value)">
<div class="form-group">
<md-input-container>
<input type="text" #nameRef mdInput required placeholder="Building name" name="name" ngModel>
</md-input-container>
</div>
<button type="submit" md-raised-button color="accent" class="pull-right">{{title}}</button>
</form>
CSS:
md-input-container input {
width: 400px;
font-size: 1.5em;
}
正如你看到的,我的CSS只有適應容器大小。
其實,這給了我一個提示。如果這有效,我會通知你。我認爲這只是解決方案的一半。 – Alberto
我正在進一步研究它,不知道創建左邊紅色邊框的CSS。我也能這樣做https://plnkr.co/edit/KCuvFH2iE4J70dWCyS6S?p=preview – Nehal
我喜歡那樣。它使用CSS內部的角元素。 – Alberto