2016-03-22 18 views
0

Ich versuche, eine vertikale Schaltflächengruppe mit Bootstrap (2) zu erstellen. Ich möchte die Tasten die gleiche Breite haben, und die Warnungen auf der rechten Seite. Ist es möglich? Das habe ich bis jetzt erreicht. http://jsfiddle.net/tnrx53ss/Bootstrap vertikale Schaltflächengruppe mit Warnungen

<div style="margin-bottom: 10px;"> 
      <div id="myButtons" class="btn-group-vertical" data-toggle="buttons-radio"> 
       <input class="newSurveyInput" type="hidden" id="Size" name="Size" value="Liten" /> 
       <button type="button" onclick="$('input#Size').val(($(this).html()))" class="btn btn-default active">First</button><div class="alert alert-info" role="alert">Alert text regarding First.</div> 
       <button type="button" onclick="$('input#Size').val(($(this).html()))" class="btn btn-default">Second</button><div class="alert alert-info" role="alert">Some other text about Second.</div> 
       <button type="button" onclick="$('input#Size').val(($(this).html()))" class="btn btn-default">Third</button><div class="alert alert-info" role="alert">Third option explained</div> 
      </div> 
     </div> 
+0

Müssen Sie Bootstrap 2.x verwenden? – ZimSystem

+0

Ich fürchte, aber wir können Spalten verwenden. – burktelefon

Antwort

0

ja, ist es möglich. Fügen Sie Bootstrap-Klassen wie folgt hinzu. Wenn Sie nichts über Bootstrap-Grid-System wissen, gehen Sie durch ein Bootstrap-Tutorial und verstehen Sie das Grid-System.

<div class = "container" style="margin-bottom: 10px;"> 
    <div id="myButtons" class="btn-group-vertical row" data-toggle="buttons-radio"> 
     <input class="newSurveyInput col-md-12" type="hidden" id="Size" name="Size" value="Liten" /> 
     <div class = "col-md-12 col-sm-12"> 
     <button type="button" onclick="$('input#Size').val(($(this).html()))" class="btn btn-default active col-md-6 col-sm-6">First</button> 
     <div class="alert alert-info col-md-6 col-sm-6" role="alert">Alert text regarding First.</div> 
     </div> 
     <div class = "col-md-12 col-sm-12"> 
     <button type="button" onclick="$('input#Size').val(($(this).html()))" class="btn btn-default col-md-6 col-sm-6">Second</button> 
     <div class="alert alert-info col-md-6 col-sm-6" role="alert">Some other text about Second.</div> 
     </div> 
     <div class = "col-md-12 col-sm-12"> 
     <button type="button" onclick="$('input#Size').val(($(this).html()))" class="btn btn-default col-md-6 col-sm-6">Third</button> 
     <div class="alert alert-info col-md-6 col-sm-6" role="alert">Third option explained</div> 
     </div> 
    </div> 
</div> 
+0

OP gab an, dass sie Bootstrap 2 verwenden – ZimSystem

+0

@Skelly Dies funktioniert auch in Bootstrap 2. Ich überprüfte. –

+0

Es funktioniert nicht entsprechend der Frage. Es gibt keine 'col * Klassen in BS 2. http://bootply.com/1JGgyIn1mM – ZimSystem

Verwandte Themen