Writing Solid HTML
Solid HTML ensures that web pages display correctly in all browsers. Here are some tips:
- All tags should be used in pairs (opening and closing tags).
- Attributes should be used with their values, for example
class="button"
. - Be case sensitive, tag names should be written in lower case in HTML5.
- Use semantic HTML, for example
<header>
,<footer>
,<nav>
.
HTML Forms
Forms are used to collect data from the user. Here are some form elements:
<form action="..." method="...">
: Specifies the start of the form.<input type="text" name="...">
: Creates text input fields.<textarea name="..."></textarea>
: Creates multi-line text fields.<select name="..."></select>
: Creates drop-down menus.<button type="submit">
: Creates a submit button.