HTML Doctype and Versions
Which declaration is correct to specify an HTML5 document and what is its main role in rendering pages?
- u003C!DOCTYPE htmlu003E; It ensures the browser uses the latest HTML standard.
- u003CDOCTYP htmlu003E; It defines a custom HTML schema.
- u003CDOCTYPE 5.0u003E; It applies HTML5 styles only.
- u003C!DOCHTMLu003E; It loads external CSS files.
- u003CDOCTYPEhtml5u003E; It triggers legacy browser mode.
Attributes and Elements Distinction
Given the tag u003Ca href='page.html' target='_blank'u003E, what do 'href' and 'target' represent in this scenario?
- They are attributes that provide extra information about the anchor element.
- They are special HTML comments.
- They are block-level HTML elements.
- They are JavaScript event functions.
- They are part of the file path syntax.
Block-Level vs. Inline Elements
When would you use a u003Cspanu003E tag over a u003Cdivu003E tag if you want to color only one word in a paragraph?
- Use u003Cspanu003E because it’s an inline element suitable for styling part of text.
- Use u003Cdivu003E because it merges with the text seamlessly.
- Use u003Cdivu003E because it's an inline-level element.
- Use u003Cspanu003E because it creates a new block on the page.
- Use u003Cdivu003E because u003Cspanu003E cannot add color.
Creating Forms and Input Fields
To collect a user's email and submit it, which is the correct minimal HTML structure?
- u003Cformu003Eu003Cinput type='email'u003Eu003Cbutton type='submit'u003Eu003C/buttonu003Eu003C/formu003E
- u003Cformu003Eu003Cdiv type='email'u003Eu003Csubmitu003Eu003C/submitu003Eu003C/divu003Eu003C/formu003E
- u003Cformsu003Eu003Cinput email='text'u003Eu003Csubmit/u003Eu003C/formsu003E
- u003Cformu003Eu003Cinput type='mail'u003Eu003Cinput type='button'u003Eu003C/formu003E
- u003Cinput type='email'u003Eu003Cformu003Eu003Cbuttonu003Eu003C/buttonu003Eu003Cformu003E
Image Tag and Accessibility
Why should every u003Cimgu003E tag always include an 'alt' attribute, and how does it help?
- It provides text for screen readers and displays if the image fails to load.
- It speeds up image downloading.
- It sets the image’s CSS class.
- It doubles as a link destination.
- It enlarges the image automatically.
Ordered vs. Unordered Lists
What is the main difference between the u003Colu003E and u003Culu003E tags when displaying a list in HTML?
- u003Colu003E makes a numbered list; u003Culu003E makes a bulleted list.
- u003Colu003E only works with tables, u003Culu003E only with paragraphs.
- u003Colu003E is for images, u003Culu003E is for videos.
- u003Colu003E defines inline text, u003Culu003E defines block text.
- u003Colu003E is obsolete; u003Culu003E should only be used.
Semantic vs. Non-Semantic Tags
Which of the following is a semantic HTML element, and what is its advantage?
- u003Carticleu003E; It describes the content’s meaning to browsers and developers.
- u003Cspanu003E; It always bolds the text automatically.
- u003Cbu003E; It represents block-level content.
- u003Cdivu003E; It is always used for navigation menus.
- u003Ccoloru003E; It specifies color semantics.
Table Structure and Headers
Given the HTML code for a table, which tags correctly represent header cells and data cells in a proper table row?
- u003Ctru003Eu003Cthu003EHeaderu003C/thu003Eu003Ctdu003EDatau003C/tdu003Eu003C/tru003E
- u003Crowu003Eu003Cheaderu003EHeadu003C/headeru003Eu003Cdatau003ECellu003C/datau003Eu003C/rowu003E
- u003Ctableheadu003Eu003Cheadu003EHeaderu003C/headu003Eu003Ctabledatau003EDatau003C/tabledatau003Eu003C/tableheadu003E
- u003Ctru003Eu003Ctdu003EHeaderu003C/tdu003Eu003Cthu003EDatau003C/thu003Eu003C/tru003E
- u003Ctrhu003Eu003Cthdu003EHeaderu003C/thdu003Eu003Ctdtu003EDatau003C/tdtu003Eu003C/trhu003E
HTML Comments Syntax
What is the correct syntax to write a comment in HTML so it will not be rendered by the browser?
- u003C!-- This is a comment --u003E
- // This is a comment //
- u003Ccommentu003EThis is a commentu003C/commentu003E
- /* This is a comment */
- [# This is a comment #]
Strong and Bold, Emphasis and Italics
What is the key difference between using u003Cstrongu003E vs. u003Cbu003E and u003Cemu003E vs. u003Ciu003E tags in HTML?
- u003Cstrongu003E and u003Cemu003E communicate semantic meaning for accessibility, while u003Cbu003E and u003Ciu003E are only for visual styling.
- u003Cbu003E and u003Ciu003E never affect appearance; u003Cstrongu003E and u003Cemu003E always change color.
- u003Cstrongu003E and u003Ciu003E should only be paired; u003Cbu003E and u003Cemu003E cannot be.
- All four tags are used strictly for underlining text.
- u003Cbu003E means heading; u003Cstrongu003E means image.