我不确定为什么我的页面会像这样偏移

时间:2019-12-19 22:58:16

标签: javascript html angular typescript firebase

<div>
  <div>
    <span class="card-title">Add Item</span>
  </div>
  <form (ngSubmit)="onSubmit()" class="col s6">
    <div class="row">
      <div class="input-field col s6">
        <input type="text" placeholder="Add Title" [(ngModel)]="item.title" name="title">
        <label>Title</label>
      </div>
      <div class="input-field col s6">
        <input type="text" placeholder="Add Description" [(ngModel)]="item.description" name="description">
        <label>Description</label>
      </div>
      <input type="submit" value="Submit" class="btn">
    </div>
  </form>
  </div>
</div>

d

尽管我不确定为什么会发生这种情况,但是我正在使用Angular和firebase创建一个简单的页面。特别是按钮和内联文本。我对此很陌生。

1 个答案:

答案 0 :(得分:0)

因此,我假设您使用https://materializecss.com (从外观和类别名称开始),我认为您在标记中缺少卡片内容和卡片类别。

<div class="card">

    <div class="card-content">

      <span class="card-title">Add Item</span>

      <form (ngSubmit)="onSubmit()" class="col s6">
        <div class="row">
          <div class="input-field col s6">
        <input type="text" placeholder="Add Title" [(ngModel)]="item.title" name="title">
        <label>Title</label>
          </div>
          <div class="input-field col s6">
        <input type="text" placeholder="Add Description" [(ngModel)]="item.description" name="description">
        <label>Description</label>
          </div>
          <input type="submit" value="Submit" class="btn">
        </div>
      </form>

    </div>

</div>

ref:https://materializecss.com/cards.html