Tim Aych
Tim Aych

Reputation: 1365

HTML5 Validation - Unclosed Elements that seem to be closed

I'm getting errors when trying to validate this page in HTML5:

For this block of html:

<form class="pure-form pure-form-aligned" id="submit_form_contact" novalidate>
        <fieldset>
            <div class="pure-control-group">
                <label for="name">Your Name:</label>
                <input id="name" type="text" placeholder="Name" name="name" required>
            </div>

            <div class="pure-control-group">
                <label for="email">Your Email:</label>
                <input id="email" type="email" placeholder="Email Address" name="email" required>
            </div>

            <div class="pure-control-group">
                <label for="email_text">Inquiry Type: </label>
                <select id="inquiry_dropdown" class="pure-input-1-2" name="inquiry">
                    <option>General</option>
                    <option>Sales & Marketing</option>
                    <option>Press & Editorial</option>
                </select>
            </div>

            <div class="pure-control-group">
                <label for="message" style="vertical-align: top;">Message:</label>
                <textarea id="message" type="text" placeholder="Enter message here..." name="message"></textarea>
            </div>                      

            <div id="errors" style="text-align: center; color: red;"></div>

                <button id="contact_submit" class="pure-button pure-button-primary" style="background-color: #003A70; float:right; margin-right: 35px;margin-top:15px;">Submit</button>
            </div>

        </fieldset>
</form>

... I can't figure out why. Everything seems to be closed properly. Can anyone spot anything I'm doing wrong?

Upvotes: 2

Views: 11760

Answers (1)

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324630

You have an </div> after your "contact_submit" button, but no corresponding <div>. This is causing the parser the ham up.

I would suggest a code editor such as Notepad++ - one of its features is tag matching, where it can tell you easily if you have mismatched tags.

Upvotes: 4

Related Questions