HTML MCQ Set 2: Intermediate
Thirty questions on tables, forms, semantic elements, metadata and accessibility. Harder than set one, and still questions only.
-
HTML Basics
- What is HTML: The Structure Layer of Every Web Page
- HTML Document Structure: DOCTYPE, html, head and body
- Elements, Tags and Attributes: The Vocabulary of HTML
- HTML Comments: Notes That Ship With Your Code
- Block Level and Inline Elements
- Writing and Running Your First HTML Page
- How a Browser Turns Markup Into a Page
- Text and Formatting
- Links and Navigation
- Images and Media
- Lists
- Tables
-
Forms
- Form Structure: form, action and method
- Input Types: Text, Email, Number, Date and the Rest
- Labels: The Most Important Element in a Form
- Checkboxes, Radio Buttons and Grouping
- select, option, optgroup and datalist
- textarea, File Uploads and Hidden Fields
- Buttons: submit, reset and button
- Built In Form Validation
- GET or POST: What Happens When a Form Is Submitted
- Semantic HTML
- HTML5 Features
- Head and Metadata
- HTML with CSS
- HTML with JavaScript
- Accessibility
-
HTML SEO
- How Google Works: Crawling, Indexing and Ranking
- SEO Friendly HTML Structure
- Titles and Descriptions That Earn Clicks
- Headings and Content Structure for Search
- Internal Linking and Anchor Text
- robots.txt and XML Sitemaps
- Canonical URLs and Duplicate Content
- Structured Data and JSON-LD
- Image SEO
- Core Web Vitals and Mobile Friendliness
- DevTools and Debugging
- Editor Productivity
- HTML Best Practices
- HTML Projects
- Advanced Projects
- Practice and Exams
How to use this set
Questions only. No answer key.
These questions are harder than set one, and several have answers that surprise people. Where you are unsure, build the case and test it - that is the whole method, and it is how you will settle these questions in real work too.
Thirty questions. Allow fifty minutes.
Tables
- What is the real difference between
thandtd?
a)this bold and centred b)thdeclares that the cell labels other cells c)thmay only appear intheadd) They are interchangeable - A table has four columns. One row contains a cell with
colspan="2". How manytdorthelements should that row contain in total?
a) 4 b) 3 c) 2 d) 5 - A cell has
rowspan="3". How many cells should the two rows beneath it contain, compared with a normal row?
a) The same number b) One fewer c) One more d) Two fewer - Which
scopevalue belongs on a header that spans several columns?
a)colb)rowc)colgroupd)rowgroup - What does wrapping header rows in
theadgive you that plain rows do not?
a) Bold text b) Repeated headers when printing across pages c) Automatic sorting d) A required validation pass - Which element gives a table its accessible name?
a)summaryattribute b)captionc) The preceding heading d)titleattribute - Which CSS declaration removes table semantics in most browsers?
a)border-collapse: collapseb)display: blockon table elements c)overflow-x: autod)table-layout: fixed
Forms
- A form field submits its value under which attribute?
a)idb)namec)classd)value - What does an unchecked checkbox submit?
a)falseb) An empty string c) Nothing at all d)off - What groups a set of radio buttons into one choice?
a) A sharedfieldsetb) A sharednamec) A sharedclassd) A sharedformattribute - How many tab stops does a group of five radio buttons occupy?
a) Five b) Two c) One d) Zero - Which is submitted: a
disabledfield or areadonlyfield?
a) Both b) Neither c) Onlydisabledd) Onlyreadonly - Which input type is wrong for a six digit postal code, and why?
a)text, because it allows letters b)number, because it strips leading zeros and adds a spinner c)tel, because it has no validation d)search, because it adds a clear button - What happens to a
buttoninside a form that has notypeattribute?
a) It does nothing b) It defaults totype="submit"c) It defaults totype="button"d) It is invalid - A file upload form must have which two things?
a)method="get"andacceptb)method="post"andenctype="multipart/form-data"c)novalidateandacceptd)method="post"andautocomplete="off" - What is a textarea value?
a) Itsvalueattribute b) The text between its tags c) Itsplaceholderd) ItsdefaultValueproperty only - Which pseudo class avoids styling an untouched required field as invalid?
a):invalidb):user-invalidc):requiredd):placeholder-shown - When is GET the correct form method?
a) When the form changes server state b) When the form asks a question, such as a search c) When the form contains a password d) When the form uploads a file
Semantic elements
- Which test decides whether content should be an
article?
a) Does it have a heading? b) Would it still make sense republished on its own? c) Is it longer than a paragraph? d) Is it insidemain? - How many visible
mainelements may a page have?
a) Any number b) One per section c) One d) One per landmark - A
sectionthat has no heading and no accessible name is:
a) Announced as a region landmark b) Not exposed as a landmark at all c) Invalid d) Treated as anarticle - When is a
headerelement a banner landmark?
a) Always b) Only when it is a direct child ofbodyc) Only when it contains anavd) Only when it has a role attribute - Why does
aria-label="Main navigation"read badly on anav?
a) It is too long b) The role is already announced, so it says navigation twice c)navcannot takearia-labeld) It should bearia-labelledby - Where must
summaryappear inside adetailselement?
a) Anywhere b) Last c) First d) It is not required to be inside - What is the
addresselement for?
a) Any postal address b) Contact details for the author or the page c) The shipping address on a form d) A location in a map embed
Metadata and accessibility
- A page is blocked in
robots.txtand also carries<meta name="robots" content="noindex">. What happens?
a) It is removed from search b) The crawler never fetches it, so it never reads the noindex, and the URL may still be listed c) Both directives apply d) The robots meta tag overrides robots.txt - A canonical link with a relative URL such as
href="/about"is:
a) Valid and works b) A common silent failure c) A validation error d) Automatically converted to absolute - Where does a control get its accessible name from, if both a bound
labeland anaria-labelare present?
a) The label b) Thearia-labelc) Both, concatenated d) Neither, it is an error - Which hides an element from sight but leaves it fully focusable by keyboard?
a)hiddenb)display: nonec)opacity: 0d)visibility: hidden - What must be true for an
aria-liveregion to announce a change?
a) It must be inserted along with its message b) It must already be in the DOM before the content changes c) It must haverole="alert"d) It must be focused
How to verify
Several of these questions have answers that are counter intuitive. Where you are unsure:
- Table arithmetic - build it and validate; the validator reports mismatched column counts directly.
- Form submission - submit it and read the Payload tab in the Network panel.
- Focus and tab order - put the mouse down and press Tab.
- Accessible names - read the computed name in the DevTools accessibility pane.
- Landmarks - list them in the accessibility tree.
Practice
- Answer all thirty before verifying any.
- Verify each in the browser and record which you were confidently wrong about.
- Take the five you found hardest and write a short explanation of each in your own words.
- Build a page that demonstrates the answers to questions 2, 3, 9 and 30 simultaneously.