This quiz is designed to test whether or not web developers have an understanding of the basic technologies used on the web, primarily HTML, HTTP, Media Types (MIME) and character repertoires and encodings. Personally, I expect every single web developer to pass this quiz with flying colours, yet reality tells me that a large proportion will struggle. So, in the interests of finding out exactly how much web developers in general do and do not know, and for your own personal benefit, I decided to publish this quiz (or survey, if you like).
Firstly, a few ground rules. Please don’t cheat. I expect all web developers to know the answers to these questions without the need for reference material or the use of automated tools. That means, please don’t make use of the validator or look up the specifications to answer these questions, they’re designed to be easy enough to answer without such tools, yet still provide enough of a challenge for all but the most knowledgeable authors. Secondly, in order to give everyone a fair go and avoid chance of having all the correct answers given away in the first response, I’ve temporarily enabled comment moderation and no comments will be appearing until I publish the results and answers next week. Ok, so on with the quiz…
This sample document applies to the first 3 questions. You may assume the HTTP headers contain:
Content-Type: text/html;charset=UTF-8
Note: This document uses some special syntax that is not widely supported in existing browsers; it is only designed to test your knowledge of HTML.
1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> 2. <html lang="en"> 3. <title/Sample HTML 4.01 Document/ 4. <p align="right">This is a sample HTML 4.01 Strict document. 5. <>How much do you know about HTML?</> 6. <!-- -- --> <em>It’s not hard!</em> <!-- -- --> 7. <p>Created by <a href=http://lachy.id.au/">Lachlan Hunt 8. </html>
Validation
Which lines in the above HTML document contain validation errors, if any? Note: I’m only looking for those errors that will be reported by a conforming SGML based validator.
Elements in the DOM
- How many
pelements are there within the above document? - Which of these elements, if any, will not be present within the the Document Object Model of the above document?
<head><body><em>
Semantics
- Which markup structure is the most semantically correct for a navigational link menu, regardless of how it will be presented visually?
-
<div class="menu"> <a href="…">Link 1</a> | <a href="…">Link 2</a> | <a href="…">Link 3</a> </div> -
<div class="menu"> <a href="…">Link 1</a><br> <a href="…">Link 2</a><br> <a href="…">Link 3</a><br> </div> -
<ul class="menu"> <li><a href="…">Link 1</a></li> <li><a href="…">Link 2</a></li> <li><a href="…">Link 3</a></li> </div>
-
- Which markup structure is the most semantically correct for a title within the document body that may be horizontally centred in a visual medium (eg. screen) using a large, bold font?
<div class="title">Document Title</div><h1>Document Title</h1><p align="center"><font size="+3"><b>Document Title</b></font></p><h1 style="font-weight:bold;font-size:large;text-align:center;">Document Title</h1><h1 class="LargeBoldCenterHeading">Document Title</h1>
Character References
Given these three numeric character references, and two character entity references:
’’’’'
- Which ones are invalid for an HTML 4.01 document?
- Which ones are invalid for an XHTML 1.0 document?
- Which ones are invalid for a generic XML document? (assume no DTD or Schema)
Media Types (MIME)
- Which of these MIME types SHOULD NOT be used for an XHTML 1.1 document?
application/xhtml+xmltext/htmlapplication/xmltext/xml
- Using the answer from the previous question, under what conditions MAY (according to the recommendation) an XHTML 1.0 document use that MIME type?