2016-04-03 86 views
5

我做了一個註冊腳本,它允許用戶註冊我的網站。現在我遇到的問題是,註冊界面所在的角度材料卡不在中心位置。我嘗試過很多事情,比如<center>和[佈局-ALIGN =「中心中心」],仍然沒有什麼工作 我的代碼:對齊角度材料卡在頁面中心

<md-content class="md-padding" layout-xs="column" layout="row"> 
    <div flex-xs flex-gt-xs="40" layout="column" layout-align="center center"> 
     <md-card class="card-40-center"> 
      <md-card-title> 
       <md-card-title-text> 
        <span class="md-headline">Sign Up</span> 
       </md-card-title-text> 
      </md-card-title> 
      <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" class="signup_form"> 
      <div class="md-padding" layout-align="center"> 
       <div layout="row"> 
      <md-input-container flex="100"> 
       <label>First name</label> 
       <input> 
      </md-input-container> 
       <md-input-container flex="100"> 
        <label>Last name</label> 
        <input> 
       </md-input-container> 
        </div> 
       <div layout="row"> 
       <md-input-container flex="100"> 
        <label>Username</label> 
        <input> 
       </md-input-container> 
       <md-input-container flex="100"> 
        <label>Email</label> 
        <input type="email"> 
       </md-input-container> 
        </div> 
       <div layout="row"> 
       <md-input-container flex="100"> 
        <label>Password</label> 
        <input type="password"> 
       </md-input-container> 
       <md-input-container flex="100"> 
        <label>Repeat Password</label> 
        <input type="password"> 
       </md-input-container> 
        </div> 
       <div ng-controller="selectGender as ctrl"> 
        <div layout="row"> 
        <md-input-container flex="100" layout="column" layout-align="center"> 
         <label>Gender</label> 
         <md-select ng-model="ctrl.userState"> 
          <md-option 
           ng-repeat="state in ctrl.states" 
           value="{{state.abbrev}}" 
           ng-disabled="$index === 2" 
          > 
           {{state.abbrev}} 
          </md-option> 
         </md-select> 
        </md-input-container> 
         <div ng-controller="selectDate"> 
          <div flex="100"> 
           <md-datepicker 
            ng-model="myDate" 
            md-placeholder="Enter date" 
           ></md-datepicker> 
          </div> 
         </div> 
         </div> 

       </div> 
      </div> 

      <md-card-actions layout="row" layout-align="center"> 
       <br> 
       <center> 
        <md-button class="md-primary md-raised signup_button" type="submit">Sign Up</md-button> 

       </center> 
       </form> 
      </md-card-actions> 
      <md-card-content> 

      </md-card-content> 

     </md-card> 
    </div> 
</md-content> 

回答

0

您沒有在正確的位置,關閉</form>標籤,

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" class="signup_form"> 
      <div class="md-padding" layout-align="center"> 
       <div layout="row"> 
      <md-input-container flex="100"> 
       <label>First name</label> 
       <input> 
      </md-input-container> 
       <md-input-container flex="100"> 
        <label>Last name</label> 
        <input> 
       </md-input-container> 
        </div> 
       <div layout="row"> 
       <md-input-container flex="100"> 
        <label>Username</label> 
        <input> 
       </md-input-container> 
       <md-input-container flex="100"> 
        <label>Email</label> 
        <input type="email"> 
       </md-input-container> 
        </div> 
       <div layout="row"> 
       <md-input-container flex="100"> 
        <label>Password</label> 
        <input type="password"> 
       </md-input-container> 
       <md-input-container flex="100"> 
        <label>Repeat Password</label> 
        <input type="password"> 
       </md-input-container> 
        </div> 
       <div ng-controller="selectGender as ctrl"> 
        <div layout="row"> 
        <md-input-container flex="100" layout="column" layout-align="center"> 
         <label>Gender</label> 
         <md-select ng-model="ctrl.userState"> 
          <md-option 
           ng-repeat="state in ctrl.states" 
           value="{{state.abbrev}}" 
           ng-disabled="$index === 2" 
          > 
           {{state.abbrev}} 
          </md-option> 
         </md-select> 
        </md-input-container> 
         <div ng-controller="selectDate"> 
          <div flex="100"> 
           <md-datepicker 
            ng-model="myDate" 
            md-placeholder="Enter date" 
           ></md-datepicker> 
          </div> 
         </div> 
         </div> 

       </div> 
      </div> 
      </form> 

入住這Plunker

這裏是repository

+0

我不在乎,我關閉該標籤,並在那裏。 Chrome可以輕鬆糾正這一點。我正在尋找的是中心對齊卡,但不是它裏面的內容 –

+0

你檢查過掠奪者嗎?它在那裏工作 – Sajeetharan

+0

你正在擴大整個屏幕,而我的是小的,我希望它在頁面的中心。我目前的卡片:http://prntscr.com/anhb7k –