Search code examples
htmlformshtml-selectline-breaks

How Do I Add a Line Break After a Dropdown Menu


I'm learning HTML, and while messing around with forms and dropdown menus, I found that I can't seem to add a line break after a dropdown. Here is what the page looks like

Adding a line break after the closing tag doesn't appear to work, and adding multiple line breaks doesn't appear to work either. Is there any way to get the first radio button under the dropdown with pure HTML? Here is my code:

<form>
    <label for="dropdown" id="dropdown-label">Select one:</label><br>
        <select name="thing" id="dropdown">
          <option value="thing1">Thing 1</option>
          <option value="thing2">Thing 2</option
        </select><br>
            
    <div>
        <input type="radio" id="num1" name="choices" value="num1">
        <label for="num1">Num1</label><br>
            
        <input type="radio" id="num2" name="choices" value="num2">
        <label for="num2">Num2</label><br>  
    </div>
</form>

Solution

  • thing 2 option tag was not closed. that's why br tag was not working.

    <form>
        <label for="dropdown" id="dropdown-label">Select one:</label><br>
            <select name="thing" id="dropdown">
              <option value="thing1">Thing 1</option>
              <option value="thing2">Thing 2</option>
            </select>
            <br>
        <div>
        
            <input type="radio" id="num1" name="choices" value="num1">
            <label for="num1">Num1</label><br>
                
            <input type="radio" id="num2" name="choices" value="num2">
            <label for="num2">Num2</label><br>  
        </div>
    </form>