I want to learn HTML and CSS. So anyone can recommend some books for HTML learning.
Can anyone check my coding of login form but is not working properly.
<input type="text" name="firstname">
<input type="text" name="lastname">
<p>Note that the form itself is not visible.</p>
<p>Also note that the default width of a text input field is 20 characters.</p>
@PromoOcodes, what do you want the form to do? You don’t have any submit button, so the form’s contents won’t be submitted. In the <form> tag, you haven’t said where this form’s contents are to be sent to be processed (You need an action="some-processing-file.php" for that), and you haven’t said how the contents are to be sent (You need a method="post" for that).
Only not required by web browsers because 95% of the web still uses HTML 3.2 where that requirement did nit yet exist.
The HTML 3.2 and HTML 4 specifications were equally useful to browser creators and web page authors but the HTML 5 specification is only written for the browser creators - we are still waiting for the specification to tell us what part of HTML 5 that web authors should be using for new HTML 5 web pages (for those of us who don’t want to go back to writing HTML 3.2 as the specification for the browsers allows). The best I have been able to work out so far is to follow the HTML 4 strict rules but allow those new tags and attributes introduced in HTML 5 that are actually supported by browsers and are useful additions and to disregard all the reintroduced HTML 3.2 tags and the tags that have no browser support (and likely never will).
Just to clarify, I was just referring to the extra wrappers between form tag and inputs not being needed, rather than the labels (which should always be used). I used to include a fieldset even for simple forms, but it was pointed out to me that it’s sometimes an accessibility annoyance, and wasn’t needed unless you need to group inputs into sections. So that’s the only time I use it now, and I don’t tend to use extra divs etc. unless I really need them as styling hooks. But I don’t see the extra containers as necessary for “validation”.