使用 Bootstrap 為輸入新增反饋圖示


要新增反饋圖示,請在 Bootstrap 中使用 .has-feedback 類。

你可以嘗試執行以下程式碼來設定反饋圖示 −

示例

即時演示

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <div class = "form-group has-feedback">
         <label class = "col-sm-2 control-label" for = "inputSuccess">Example</label>
         <div class="col-sm-10">
            <input type = "text" class="form-control" id = "inputSuccess">
            <span class = "glyphicon glyphicon-ok form-control-feedback"></span>
         </div>
      </div>
   </body>
</html>

更新於: 12-6 月-2020

715 瀏覽

開啟你的職業生涯

完成課程獲得認證

開始
廣告
© . All rights reserved.