Align radio button mobile

Asked

Viewed 447 times

0

I’m having trouble leaving the radio button next to the text.

Only in the mobile version that is "breaking" (The text is on top and the radio buttom go to the bottom line).

I need you to stay like this:

Modelo

This is my code:

<div class="row">
    <div class="form-group col-md-12 col-sm-12">    
        <p align="center">Isso é um texto de exemplo :)</p>                         
            <div class="radio" >    
                <label class="radio-inline"><input type="radio" value="Sim" name="optradio">Sim</label>                 
                <label class="radio-inline"><input type="radio" value="Não" name="optradio">Não</label>                         
            </div>                                  
    </div>  
</div>

Look how you’re getting:

inserir a descrição da imagem aqui

Even if I decrease the size of the radio it doesn’t stand next to the text :/

  • Man here they stood right next to each other even on small screens! type 120px wide... Have you made any CSS? If yes put there please

  • I’m using the bootstrap CDN only. And here it’s not getting expensive. Like, it has to be the image way. The Radio button, then the text "Yes" and then the other radio button and the text "No" .

1 answer

0


I made some small additions to your code, try whenever possible to use the classes that bootstrap provides, this will make these "breaks" do not happen. Another important point is to take care not to use these classes in inappropriate elements. Any questions give a look at documentation.

<div class="row">
  <div class="form-group col-md-12 col-sm-12">
    <div class="alinhamento">
      <p align="center">Isso é um texto de exemplo :)</p>
      <div class="radios">
        <label class="radio-inline"><input type="radio" value="Sim" name="optradio">Sim</label>
        <label class="radio-inline"><input type="radio" value="Não" name="optradio">Não</label>
      </div>
      <input type="text" class="form-control" id="inputTest">
    </div>
  </div>
</div>

Follows Jsfiddle with the code.

  • Man, nothing’s changed here. I edited the post, look at it there.

  • I found out here what it was guy. Thank you very much. Your code is correct :) Vlw.

Browser other questions tagged

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