What is <br class="clear" /> in Html?


You know of any free form builders that generate html5 and upto date php ?
This form generates out of date php:

Let me know whether the html is html5 or not.


<form id="form1" name="form1" method="post" action="url_submission.php">
<label for="page_url">Page Url</label><input type="text" name="page_url" id="page_url" />
<br class="clear" /> 
<label for="page_description">Page Description</label><textarea name="page_description" id="page_description" cols="45" rows="5"></textarea>
<br class="clear" /> 
<label for="Subscribe_To_Newsletter">Subscribe_To_Newsletters</label>
<input type="checkbox" name="Subscribe_To_Newsletters[]" value="National" id="National_0" />National
<input type="checkbox" name="Subscribe_To_Newsletters[]" value="International" id="International_1" />International
<br class="clear" /> 
<label for="gender">Gender</label>
<input type="radio" name="gender" value="Male" id="gender_0" />Male
<input type="radio" name="gender" value="Female" id="gender_1" />Female
<br class="clear" /> 
<label for="send_email_copy">Send You Copy ?</label><select name="send_email_copy" id="send_email_copy">
<option value="Yes">Yes</option>
<option value="No">No</option>
<br class="clear" /> 
<label for="username">Username</label><input type="text" name="username" id="username" />
<br class="clear" /> 
<label for="password">Password</label><input type="password" name="password" id="password" />
<br class="clear" /> 
<label for="browse">File</label><input type="file" name="browse" id="browse" />
<br class="clear" /> 
<input type="submit" name="submit" id="submit" value="Submit" />
<br class="clear" /> 

Quite frankly, this part beats me! Why you think it is for ?

<br class="clear" /> 

At a guess, I’d say they were using CSS floats for layout, and adding that to clear the floats, but without seeing the CSS, there’s no way to be sure.

It’s an incorrect use of <br> tags, in any case.


As @TechnoBear said it sounds like the input and label were floated so you would need to clear each pair before starting another row. There is probably some as applied to the break that clears the float.

Using breaks in forms is ok but probably much better to wrap each pair in a div instead as it makes it easier to manage and indeed may be necessary if you are doing inline form validation.

1 Like

I usually use the div but this time I used the form builder and what you see is what it built. Built my form with bad coding. Not relying on it.
But if you guys know of a good form builder online then let me know. Prefer using them to save time.

This is also a poor solution.


<label>Foo</label> <input />
<label>Bar</label> <input />


label, input {width: 200px; float left;  margin-bottom: 5px}
label {clear: left} 

Validation can be done with :after and HTML data


Isn’t this why we have flexbox now?
I don’t think I’ve used float at all this year…

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.