HTML 5 is somewhat looser in its requirements for markup compared to XHTML, allowing a number of shortcuts:
- Tags can be written uppercase, lowercase, or in mIxEd case.
- You can drop a lot of closing tags:
</li>
,</dt>
,</dd>
,</tr>
,</th>
,</td>
,</thead>
,</tfoot>
,</tbody>
,</option>
,</optgroup>
,</p>
(in most cases),</head>
,</body>
and</html>
not required. - Attribute values only need to be quoted if they contain spaces or some non-alphanumeric characters (such as a question mark). So
<div id=wrapper>
is legitimate, as is<img src=assets/images/falls.jpg …>
but<img alt=Angel Falls …>
is not. - You can eliminate
http:
at the start of links becomes<a href=//example.com>
(This is not specific to HTML5, but it is fun all the same).
You will see these shortcuts used in some code examples on this blog in order to save space.
JavaScript Training in Chennai | Angular 2 Training in Chennai | HTML5 Training in Chennai | JQuery Training in Chennai
ReplyDeleteYeoman Training | D3 Training | ReactJS Training | Gulp Training | CommonJS Training
HTML5 Training in Chennai | Angular 2 Training in Chennai | Node.js Training in chennai | Ecmascript 6 Training in Chennai | ES6 Training in Chennai