test
HTML – Basics & Structure
1. What does HTML stand for?
a) HighText Machine Language
b) HyperText and links Markup Language
c) HyperText Markup Language
d) None of the above
2. What is the correct sequence of HTML document structure?
a) html, head, body
b) head, html, body
c) body, html, head
d) html, body, head
3. Which tag is used to define the metadata of a document?
a) <body>
b) <head>
c) <meta>
d) <title>
4. Where is the <title> tag placed in an HTML document?
a) Inside <body>
b) Inside <head>
c) After <html>
d) Before <html>
5. Which tag is used to insert a line break in HTML?
a) <lb>
b) <br>
c) <break>
d) <line>
---
Formatting Tags
6. Which HTML tag makes text bold?
a) <b>
b) <strong>
c) Both a and b
d) None of the above
7. The <i> tag is used for:
a) Underlining text
b) Italicizing text
c) Making text bold
d) Displaying images
8. What does the <u> tag do?
a) Makes text italic
b) Underlines text
c) Adds a hyperlink
d) Adds a bullet
9. Which tag is used to show text exactly as written (including whitespace)?
a) <div>
b) <pre>
c) <span>
d) <code>
10. What is the purpose of the <strike> tag?
a) To highlight text
b) To underline text
c) To strike through text
d) To bold text
---
Anchors & Images
11. Which tag is used to create hyperlinks?
a) <a>
b) <link>
c) <href>
d) <hyper>
12. What attribute is used in <a> tag to define the link address?
a) src
b) href
c) alt
d) link
13. What is a Named Anchor in HTML?
a) A tag to open new tabs
b) A link to an external site
c) A bookmark within a page
d) A table caption
14. Which tag is used to display an image in HTML?
a) <img>
b) <picture>
c) <src>
d) <image>
15. Which attribute is used in <img> to define the image path?
a) link
b) src
c) href
d) alt
---
Paragraphs & Comments
16. Which tag is used to define a paragraph?
a) <p>
b) <para>
c) <paragraph>
d) <text>
17. How do you insert comments in HTML?
a) // Comment
b) / Comment /
c) <!-- Comment -->
d) Comment
---
Tables
18. What tag is used to create a table row?
a) <td>
b) <tr>
c) <th>
d) <table>
19. What tag defines a table header cell?
a) <td>
b) <tr>
c) <th>
d) <head>
20. What tag is used to define a cell in a table?
a) <cell>
b) <data>
c) <td>
d) <tr>
21. Which attribute sets space between cell content and cell border?
a) cellpadding
b) cellspacing
c) border
d) margin
22. What does the colspan attribute do?
a) Joins rows
b) Joins columns
c) Sets cell padding
d) Adds border
23. Which attribute is used to merge cells vertically in a table?
a) rowspan
b) colspan
c) cellpadding
d) merge
24. Which attribute sets the space between table cells?
a) cellpadding
b) cellspacing
c) margin
d) border-spacing
---
Lists
25. What tag is used for an unordered list?
a) <ul>
b) <ol>
c) <li>
d) <dl>
26. What tag is used for a list item?
a) <list>
b) <li>
c) <item>
d) <ul>
27. What tag is used for an ordered list?
a) <ol>
b) <ul>
c) <dl>
d) <li>
28. Which list displays items with numbers by default?
a) <ul>
b) <ol>
c) <dl>
d) <li>
29. Which list uses definition terms and descriptions?
a) <ol>
b) <ul>
c) <dl>
d) <li>
---
Forms & Inputs
30. What tag is used to create a form in HTML?
a) <input>
b) <form>
c) <fieldset>
d) <textarea>
31. Which tag is used to create a multi-line text input?
a) <input type="text">
b) <textarea>
c) <textbox>
d) <text>
32. What tag is used to create a dropdown list?
a) <select>
b) <dropdown>
c) <input type="dropdown">
d) <option>
33. What input type is used to create radio buttons?
a) type="radio"
b) type="button"
c) type="checkbox"
d) type="option"
34. What input type is used to select multiple options?
a) radio
b) select
c) checkbox
d) dropdown
35. Which input type submits form data to the server?
a) type="submit"
b) type="reset"
c) type="button"
d) type="form"
36. Which attribute resets all form fields?
a) type="clear"
b) type="reset"
c) type="default"
d) type="refresh"
37. What attribute is used to make a field required in HTML5?
a) mandatory
b) required
c) mustfill
d) validate
---
Frames
38. What tag is used to define a frame in HTML?
a) <frame>
b) <frameset>
c) <iframe>
d) All of the above
39. Which tag is used to nest frames?
a) <nestedframe>
b) <subframe>
c) <frameset>
d) <iframe>
40. Which tag is used to embed a frame inside a webpage in modern HTML?
a) <frame>
b) <iframe>
c) <frameset>
d) <frametag>
---
HTML5 Tags & Form Attributes
41. Which HTML5 tag is used to define a section in a document?
a) <section>
b) <div>
c) <article>
d) <nav>
42. What is the purpose of the <nav> tag in HTML5?
a) To add navigation links
b) To display articles
c) To group headings
d) To link CSS
43. Which tag defines self-contained content in HTML5?
a) <aside>
b) <nav>
c) <article>
d) <section>
44. What tag is used to play audio files in HTML5?
a) <audio>
b) <music>
c) <sound>
d) <media>
45. Which tag is used for embedding video content in HTML5?
a) <video>
b) <media>
c) <mp4>
d) <movie>
46. Which attribute in HTML5 is used to validate an email format?
a) type="text"
b) type="email"
c) type="string"
d) type="validate"
47. Which attribute helps apply a regular expression in a form field?
a) regex
b) expression
c) pattern
d) validate
48. What does the autofocus attribute do?
a) Highlights the whole form
b) Makes all fields required
c) Automatically sets focus to the input field
d) Changes the field to read-only
49. Which input type is used to select a date in HTML5?
a) type="calendar"
b) type="time"
c) type="date"
d) type="day"
50. What HTML5 input type is used to select values in a defined range?
a) type="slider"
b) type="range"
c) type="bar"
d) type="number"
1. Which of the following is the correct extension for an HTML file?
a) .htmldoc
b) .htx
c) .html
d) .htn
2. The HTML element used to define the main body content is:
a) <page>
b) <section>
c) <main>
d) <content>
3. The tag used to group block elements together is:
a) <span>
b) <container>
c) <div>
d) <group>
4. Which of the following is a block-level element?
a) <em>
b) <span>
c) <strong>
d) <p>
5. What is the default alignment of text inside a <p> tag?
a) Center
b) Justify
c) Left
d) Right
---
**Text Formatting & Presentation**
6. What does the <mark> tag do in HTML5?
a) Highlights text
b) Blinks text
c) Makes text red
d) Converts text to uppercase
7. Which tag is used to define keyboard input?
a) <kbd>
b) <type>
c) <key>
d) <inputtext>
8. The <small> tag is used to:
a) Reduce font size
b) Show error message
c) Convert to subscript
d) Add a caption
9. The <sub> and <sup> tags are used for:
a) Text highlighting
b) Text decoration
c) Subscript and superscript
d) Italics and bold
10. Which tag is used to emphasize text in HTML?
a) <stress>
b) <em>
c) <highlight>
d) <i>
---
**Hyperlinks & Anchors**
11. Which attribute in the <a> tag is used to open a link in a new tab?
a) ref="new"
b) window="new"
c) target="_blank"
d) open="true"
12. To link to an email address, which format is correct?
a) <a href="emailto:info@example.com">
b) <a href="mailto:info@example.com">
c) <a email="info@example.com">
d) <a hrefmail="info@example.com">
13. What attribute is used to define the tooltip text for an anchor tag?
a) alt
b) label
c) title
d) caption
14. Which tag is used to create a link to a specific point on the same page?
a) <namelink>
b) <idanchor>
c) <a name="...">
d) <tag="...">
15. Which protocol prefix is used in <a> to link to a phone number?
a) sms:
b) tel:
c) call:
d) mobile:
---
**Images & Media**
16. What attribute in the <img> tag provides alternate text for an image?
a) title
b) tooltip
c) alt
d) label
17. Which attribute is used to set width of an image in percentage?
a) size
b) width
c) percentage
d) scale
18. To add a clickable image that links to another page, you use:
a) <a img="...">
b) <link><img></link>
c) <a href="..."><img></a>
d) <img link="...">
19. Which attribute allows you to align an image horizontally?
a) position
b) horizontal-align
c) align
d) float
20. Which format is not typically used for images on web pages?
a) .jpg
b) .bmp
c) .gif
d) .webp
---
**Tables – Advanced**
21. Which tag is used to group the table header content?
a) <thead>
b) <head>
c) <tblhead>
d) <header>
22. Which tag groups table body rows?
a) <tbody>
b) <body>
c) <content>
d) <tablebody>
23. Which tag is used to group the footer in a table?
a) <tfoot>
b) <foot>
c) <bottom>
d) <tblfoot>
24. Which attribute is used to apply a background color to a table row?
a) color
b) bgcolor
c) background
d) rowcolor
25. Which attribute in <table> specifies the thickness of the border?
a) thickness
b) line
c) border
d) frame
---
**Lists – Advanced**
26. The <ol type="A"> will generate list items in:
a) Numbers
b) Lowercase letters
c) Roman numerals
d) Uppercase letters
27. What is the default marker type for unordered lists?
a) Square
b) Circle
c) Disc
d) None
28. Which tag defines a term in a definition list?
a) <dl>
b) <dd>
c) <dt>
d) <term>
29. What tag describes the definition in a definition list?
a) <define>
b) <df>
c) <dd>
d) <dt>
30. Which attribute is used in <ol> to start the list from a specific number?
a) count
b) begin
c) start
d) from
---
**Forms – Advanced**
31. What input type hides the text entered by the user?
a) type="secure"
b) type="code"
c) type="password"
d) type="hidden"
32. Which tag groups related form elements visually?
a) <group>
b) <fieldset>
c) <div>
d) <formset>
33. Which tag provides a caption for <fieldset>?
a) <label>
b) <title>
c) <caption>
d) <legend>
34. Which input type allows selecting a file from the system?
a) type="file"
b) type="data"
c) type="image"
d) type="document"
35. Which attribute is used to make a form field inactive?
a) readonly
b) inactive
c) disable
d) disabled
36. Which input type creates a slider in HTML5?
a) type="scroll"
b) type="bar"
c) type="slide"
d) type="range"
37. Which attribute helps autofill saved values in the browser?
a) autofill
b) remember
c) autocomplete
d) prefill
38. The name attribute in form elements is mainly used for:
a) Styling
b) JavaScript
c) Server identification
d) Field focus
39. Which element lets you display static text inside a form?
a) <static>
b) <label>
c) <output>
d) <display>
40. What is the purpose of the <label> tag?
a) To group inputs
b) To provide placeholder text
c) To describe input fields
d) To submit the form
---
**HTML5 Semantic & Media Elements**
41. Which tag is used for content that is slightly related to the main content?
a) <section>
b) <aside>
c) <extra>
d) <float>
42. Which tag replaces the older <bgsound> in modern HTML?
a) <media>
b) <embed>
c) <audio>
d) <sound>
43. What attribute in the <video> tag allows it to play automatically?
a) start
b) loop
c) autoplay
d) play
44. Which attribute is used in <audio> or <video> to show controls?
a) display="on"
b) controls
c) buttons="true"
d) show="yes"
45. Which tag in HTML5 represents independent content?
a) <block>
b) <article>
c) <aside>
d) <main>
46. Which input type limits value selection to predefined options with typing?
a) type="picker"
b) type="range"
c) <datalist>
d) type="dropdown"
47. What is the role of the pattern attribute in forms?
a) To change colors
b) To apply regex validation
c) To filter options
d) To disable fields
48. Which tag represents a navigation menu?
a) <nav>
b) <menu>
c) <navigate>
d) <ulnav>
49. Which tag is used to group content together in the main document flow?
a) <bodygroup>
b) <main>
c) <join>
d) <divset>
50. Which input type accepts only numbers in HTML5?
a) type="int"
b) type="digit"
c) type="calc"
d) type="number"