Button placement on bootstrap

Asked

Viewed 7,744 times

1

I have a website based on a template bootstrap, on one of the pages I added a button and as much as I gave the command to be aligned to the right, it is always left and misaligned in relation to the form.

My code:

<div class="row">
          <div class="col-lg-4">
            <fieldset class="form-group">
              <label>Produto:</label>
                                      <select class="form-control form-control-line">
                            <option>-- Selecione --</option>
                            <option>Nome do Produto A</option>
                            <option>Nome do Produto B</option>

                          </select>
          </fieldset></div>
          <div class="col-lg-4">
            <fieldset class="form-group">
              <label>Ocultar afiliados sem vendas</label>
                                      <select class="form-control form-control-line">
                            <option>-- Selecione --</option>
                            <option>Sim</option>
                            <option>Não</option>

                          </select>
          </fieldset></div>
          <div class="col-lg-4">
           <label>Classificar por::</label>
                                      <select class="form-control form-control-line">
                            <option>-- Selecione --</option>
                            <option>TOP Afiliados</option>
                            <option>Afiliados mais antigos</option>Novos Afiliadoss
                              <option>Afiliados com mais tráfego</option>


                          </select>
          </div>
    <button type="button" class="btn">Filtrar</button>

        </div>
  • you are used col-lg-4 for each select, change to col-lg-3, included the button, so you subdivide the grid correctly.

  • Thank you very much, Getulio!

1 answer

2


Despite the low quality of your question, I think I can assume it’s related to the "Filter" button. It is important that you add such information to your question, such as bringing the code part to the question.


You inserted the button directly into the line grid of Bootstrap (.row). The correct is to add a column (.col) as container from your button. Then you can style this column by positioning the content wherever you want.

<div class="col-lg-12" style="text-align: right;">
    <button type="button" class="btn">Filtrar</button>
</div>

Notice I added the class .col-lg-12 which ends up occupying the 12 grid columns. For more details, see the Bootstrap documentation (link at the end of the answer). I also added the style text-align: right in order to position your button on the right side. I added it right into the element (hard-coded), but it’s best to do it right into your website’s style file (.css).

See the result:

Print

Recommended reading: Bootstrap - Grid System

  • 1

    Thank you so much! It helped a lot! I’m still learning to program.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.