Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding <br> tag inside a div tag failed

Tags:

html

I have this HTML code:

<div id="welcomename">
    <h1>Welcome! What's your name?</h1>
    <input type="text" class="form" name="name" placeholder="Your name here!" id="name"/>
    <input type="button" onclick="clicked();" value="I'm ready!"/>
</div>
<br>

That works absolutely perfectly, but I for reasons, I need that <br> inside the div 'welcomename'. When I do this though, it doesn't work.

Other code:

<div id="hiddenDiv" style="display: none;">
    <h1 id="welcomehowareyou">How are you today, ?</h1>
    <form id="welcomehowareyou2" method="post">
        <select name="mood" onchange="popup(this.options.selectedIndex)">
            <option value="" disabled selected>How are you?</option>
            <option>I'm doing great, thanks!</option>
            <option>I'm fine, but could be better</option>
            <option>I feel absolutely terrible today.</option>
            <!--<input type="submit" value="Done!"/>-->
    </form>
    <p></p>
</div>
like image 502
JugglingBob Avatar asked Apr 20 '15 05:04

JugglingBob


Video Answer


1 Answers

You are adding the "br" just before the closing of the div and after the input element right? It is because the input element is an inline element.

like image 146
majorhavoc Avatar answered Sep 28 '22 06:09

majorhavoc