Buttons
Here is my code, and i dont know how to place the buttons side to side. (btw I'm new at coding)
<div class="second">
           <div class="col-md-12 text-center">
               <form>
            <button class="btn btn-primary btn-lg" type="submit" formaction="1klasse.html">1.klasse </button>
               </form>
           </div>
            <div class="col-md-8 text-center">
                <form>
                    <button class="btn btn-primary btn-lg" type="submit" formaction="1klasse.html">2.klasse </button>
                </form>
            </div>
        </div>
                Use the . btn-group class in Bootstrap to group buttons on a single like.
You can use an out div with a class btn-group . This helps to align the buttons horizontally. Using col-md-6 for each button div can make the buttons missaligned with unwanted space in between.
Instead of applying button sizing classes to every button in a group, just add . btn-group-* to each . btn-group , including each one when nesting multiple groups.
Since you are using bootstrap, there are a few things you need to know:
.col class will not work without putting the class within .container and .row classes. The other important thing is that the column numeric sizes add up to 12; right now yours add to 20. So your code should look more like this:
<div class="container">
  <div class="row">
    <div class="col-12 col-md-6">
       <form>
        <button class="btn btn-primary btn-lg" type="submit" formaction="1klasse.html">1.klasse </button>
       </form>
    </div>
    <div class="col-12 col-md-6">
      <form>
        <button class="btn btn-primary btn-lg" type="submit" formaction="1klasse.html">1.klasse </button>
       </form>
    </div>
  </div>
</div>
Here is a codepen to show it working
Refer to Bootstrap documentation on grids as well
Just put the buttons inside the same form and div
<div class="second">
     <div class="col-md-12 text-center">
           <form>
                <button class="btn btn-primary btn-lg" type="submit" formaction="1klasse.html">1.klasse </button>
                <button class="btn btn-primary btn-lg" type="submit" formaction="1klasse.html">2.klasse </button>
            </form>
      </div>
</div>
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With