The document provides a quiz to test understanding of proper HTML tag usage and structure. It presents several code examples with intentional errors and asks the reader to identify the errors. After selecting an answer, it provides the correct response explaining the nature of the error. The quiz covers topics like ensuring all tags have opening and closing versions, using tags in the proper hierarchical order, and correctly formatting empty elements.
2. In the following examples see if you can spot the error. ( Don’t worry if you can’t the first time. Just work through and look at the answers. Then, go through again and see if you can get it right that time.
10. <html> <head> <title></title> </head> <body> <body> </html> Can you spot the error below? The second body tag should be </body>. As it’s the second tag it should close the first one. Closing tags have a / in them
12. <html> <head> <title><title/> </head> <body> <body> </html> Can you spot the error below? The second title tag has the / in the wrong place. It should be <title></title>
13. <html> <body> <title></title> </body> <head> </head> </html> Can you spot the error below? Click for answer
14. <html> <body> <title></title> </body> <head> </head> </html> Can you spot the error below? There are 2 errors with this one. Firstly, the body and head tags are in the wrong order. The <head> should come before <body>. Secondly, the <title> should appear within the <head> tags not the <body>.
18. <html> <head> <title></title> </head> <body> </html> </body> Can you spot the error below? The closing <html> and <body> tags are the wrong way round. Because html was started first, it contains the body tag. This means that the body tag must be closed first.