How to align the dropdown menu with the text?

Asked

Viewed 251 times

3

I’m having trouble lining up my menu dropdown, the entire form and including the text that should accompany the menu dropdown this right. Any tips?

Ex. Result obtained: |dropdown| Choose an ingredient:

Upshot expected: Choose an ingredient: |dropdown|

Code from my menu dropdown

<div class="form-group">Ingredientes:
<SELECT NAME="ingredientes"  class="col-md-4 control-label" required="1">
            <option Selecione...</option>
            <?php
            while($dados3 = mysql_fetch_array($q3))
            {   
            ?>
             <option value="<?=$dados3['id_ingredientes'] ?>">
            <?=$dados3['nome'] ?>
            </option>
            <?php
                }
            ?>

    </SELECT>
</div>

Menu print:

o problema

  • insert the "choose an ingredient" into a span to stand next to or a li into the "choose an ingredient" and select to stay below, if to stand before, use span and the position relative and float left property already in select use position relative and float right will be next to each other

  • has an error without its option, is <option selectoone...></option> change to <option>select</option>

  • @flourigh thanks for answering, I don’t know if I understand what you mean, I’m kind of new in php. But I’d like to leave the word ingredient first and then the options

1 answer

3


If I understand correctly, try it this way:

<div class="form-horizontal">
    <div class="form-group">
        <label for="ingredientes" class="col-sm-2 control-label">Escolha um ingrediente</label>
        <select name="ingredientes" id="ingredientes" class="col-md-4 control-label" required="1">
            <option>Selecione</option>
            <?php
            while($dados3 = mysql_fetch_array($q3)) {   
            ?>
            <option value="<?= $dados3['id_ingredientes'] ?>">
                <?= $dados3['nome'] ?>
            </option>
            <?php
            }
            ?>
        </select>
    </div>
</div>

Always check the Bootstrap documentation, you can help http://getbootstrap.com/css/

  • thanks for the help, that’s right!!!!

Browser other questions tagged

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