2016-08-25 39 views
1

我在运行旧材料版本时有这种日志。 我决定升级以利用这些新功能。升级角材料打破了MD输入换行符

更新后,形式打破这样的代替示出在不同的行的输入,它们被示出在下面的同一行:

THE UPDATE

前的更新后

enter image description here

这是代码:

<div class="form-container"> 
      <form class="form-horizontal" action="javascript:;"> 

       <md-input-container md-no-float> 
        <label>Email</label> 
        <input type="email" placeholder="Enter your email" ng-model="email" required> 
       </md-input-container>  

       <md-input-container> 
        <label>Password</label> 
        <input type="password" placeholder="Type your password" ng-model="password" required> 
       </md-input-container> 
    </form> 

</div> 

什么可能是错误的?

+0

'这是代码:'但是没有代码? – Roope

+0

对不起@Roope,那里是 –

回答

1

只需使用class="md-block"md-input-container秒 - CodePen

enter image description here

标记

<div ng-controller="AppCtrl" ng-cloak="" ng-app="MyApp"> 
    <div class="form-container"> 
    <form class="form-horizontal" action="javascript:;"> 

     <md-input-container md-no-float class="md-block"> 
     <label>Email</label> 
     <input type="email" placeholder="Enter your email" ng-model="email" required> 
     </md-input-container>  

     <md-input-container class="md-block"> 
     <label>Password</label> 
     <input type="password" placeholder="Type your password" ng-model="password" required> 
     </md-input-container> 
    </form> 
    </div> 
</div> 

编辑:上述方法是正确的角料的方式,但如果你想减少两个输入之间的差距只是使用一点CSS - CodePen

标记

<md-input-container class="md-block" id="password"> 

CSS

#password { 
    margin-top: -10px 
} 
+0

谢谢@camden_kid。问题是,如果我添加它显示输入之间非常大的gep(相同的行为,如果我围绕一个div上的两个输入) –

+0

@AlejandroLozdziejski - 对不起,我一直在改变答案。你是在回应'layout =“列还是'md-block'?后者是更好的解决方案。 –

+0

@AlejandroLozdziejski - see edit –