2016-03-21 33 views
-3

我目前正在編輯我的登錄頁面,並且我發現我的引導程序圖標沒有對齊,因爲用戶名。它應該是中心,但現在它在用戶名框字段略微上升。如何編輯爲中心。如何格式化引導

其次,如何設置如果第一次重新加載到頁面,圖標不顯示,直到我開始鍵入用戶名。

<h3 class="form-title">Login to your account</h3> 
        <div class="alert alert-danger display-hide"> 
         <button class="close" data-close="alert"></button> 
        </div> 
         <div class="form-group has-feedback" ng-class="loginForm.username.$valid ? 'has-success' : 'has-error';"> 
          <label class="control-label" for="username">Username</label> 
          <input type="text" class="form-control" id="username" name="username" 
            ng-model="input.username" required> 
          <span class="glyphicon form-control-feedback" 
            ng-class="loginForm.username.$valid ? 'glyphicon-ok' : 'glyphicon-remove';"></span> 
         </div> 

my login page

回答

0

(我目前正在編輯我的登錄頁面,我發現我的引導程序圖標是不對齊作爲用戶名。它應該是中心,但現在它略微在用戶名框字段。如何編輯爲中心。)

  • 你可以通過填充頂或填充底部

的(第二,如何設置設置,如果第一次重新加載頁面時,圖標不顯示,直到我開始鍵入用戶名。)

  • 你必須添加JavaScript輸入焦點添加CSS不透明度1.和默認添加CSS不透明度0.參考下面的代碼。

CSS - .your-container-class .glyphicon { opacity: 0;}

JS - $("#username").focusin(function() { $("#username").siblings(".glyphicon").css("opacity", "1"); });

0

您可以使用CSS通過它的使用保證金調整調整元素比對(在這種情況下,圖標):

.your-container-class .glyphicon { 
    margin-top: 15px; 
} 

請務必將您的表格,一個div一個類或ID,以避免所有的圖形在你的應用程序樣式:-)