2017-06-08 10 views
0

このコードを使用すると、テキスト入力が表示されず、位置をクリックしている間にテキスト入力が非常に小さくなります。私はあなたの選択にクラスを追加することによってこれを行うことができますインライン HTMLselect2の入力テキストの幅を変更して、タグをインラインで表示する方法はありますか?

<!-- Select2 js--> 
    <script type="text/javascript" 
    src="http://propeller.in/components/select2/js/select2.full.js"> 
    </script> 
    <!-- Propeller Select2 --> 
    <script type="text/javascript" 
    src="http://propeller.in/components/select2/js/pmd-select2.js"></script 
    <div class="form-group pmd-textfield pmd-textfield-floating-label"> 
     <label>Keywords/Tags (Type 5 to 20 items) </label> 
     <select class="select-add-tags form-control pmd-select2-tags" multiple> 
     <option>Dallas Cowboys</option> 
      <option>New York Giants</option> 
      <option>Philadelphia Eagles</option> 
      <option>Washington Redskins</option> 
      <option>Chicago Bears</option> 
      <option>Detroit Lions</option> 
      <option>Green Bay Packers</option> 
      <option>Minnesota Vikings</option> 
      </select> 
      </div> 

CSS

/* Select2 css */ 
@import "http://propeller.in/components/select2/css/select2.min.css"; 
@import "http://propeller.in/components/select2/css/select2-bootstrap.css"; 

/* Propeller typography */ 
@import "http://propeller.in/components/typography/css/typography.css"; 

/* Propeller text fields */ 
@import "http://propeller.in/components/textfield/css/textfield.css"; 

/* Propeller select2 */ 
@import "http://propeller.in/components/select2/css/pmd-select2.css"; 
/*---header css--*/ 

JS

<!-- Propeller Select2 --> 

    $(document).ready(function() { 
     <!-- Select & Add Multiple Tags --> 
     $(".select-add-tags").select2({ 
      tags: true, 
      theme: "bootstrap", 
     }) 
    }); 
+0

[select2 - 入力とドロップダウンに異なる幅を設定する]の複製が可能です(https://stackoverflow.com/questions/16519233/select2-setting-different-width-to-input-and-dropdown) –

答えて

0

する必要があり、通常のwisthとタグで入力されたテキストが入力されていることを望みますCSSを使用してスタイルを設定する この回答を確認してください。 https://stackoverflow.com/a/16519861/7621536

関連する問題