HTML and Web Design Quiz

Loading quiz…

About this quiz

HTML tags, lists, tables, forms and CSS basics.

This Lok Sewa practice set has 50 multiple-choice questions (Subject: Computer · For: Computer Operator · Level: Medium). Take the quiz above first; after that, use the study list below to revise every question with its correct answer and a short explanation.

Study list: all 50 questions with answers and explanations
  1. HTML stands for:

    • A) High Text Machine Language
    • B) HyperText Markup Language ✔
    • C) HyperTool Multi Language
    • D) Home Text Markup Link

    Why: HTML is HyperText Markup Language.

  2. HTML was created by:

    • A) Bill Gates
    • B) Charles Babbage
    • C) Tim Berners-Lee ✔
    • D) Dennis Ritchie

    Why: Tim Berners-Lee created HTML and the WWW.

  3. The root element of an HTML page is:

    • A) ‹body›
    • B) ‹head›
    • C) ‹title›
    • D) ‹html› ✔

    Why: The ‹html› tag is the root element. Every other element, including ‹head› and ‹body›, is placed inside it.

  4. Which section is not displayed in the browser window?

    • A) ‹head› ✔
    • B) ‹body›
    • C) ‹p›
    • D) ‹h1›

    Why: The head holds information about the page.

  5. Text inside the ‹title› tag appears on the:

    • A) Page footer
    • B) Browser tab or title bar ✔
    • C) First paragraph
    • D) Status bar only

    Why: The title shows on the tab.

  6. The largest heading tag is:

    • A) ‹h6›
    • B) ‹head›
    • C) ‹h1› ✔
    • D) ‹big›

    Why: h1 is largest, h6 smallest.

  7. Which tag creates a paragraph?

    • A) ‹para›
    • B) ‹pg›
    • C) ‹text›
    • D) ‹p› ✔

    Why: The ‹p› tag creates a paragraph. Browsers add space before and after each paragraph automatically.

  8. Which tag inserts a line break?

    • A) ‹br› ✔
    • B) ‹lb›
    • C) ‹break›
    • D) ‹hr›

    Why: The ‹br› tag inserts a single line break and has no closing tag. ‹hr› draws a horizontal line instead.

  9. Which tag draws a horizontal line?

    • A) ‹line›
    • B) ‹hr› ✔
    • C) ‹br›
    • D) ‹hl›

    Why: ‹hr› is a horizontal rule.

  10. An HTML tag with no closing tag is called:

    • A) A container tag
    • B) A meta tag
    • C) An empty tag ✔
    • D) A body tag

    Why: ‹br› and ‹hr› are empty tags.

  11. Which tag makes text bold?

    • A) ‹i›
    • B) ‹u›
    • C) ‹em›
    • D) ‹b› ✔

    Why: ‹b› or ‹strong› make text bold.

  12. To write the 2 in H₂O (written below the line), use:

    • A) ‹sub› ✔
    • B) ‹sup›
    • C) ‹small›
    • D) ‹low›

    Why: The ‹sub› tag writes text as subscript, below the normal line, as in H₂O. ‹sup› writes superscript, above the line.

  13. To write the 2 in x² (written above the line), use:

    • A) ‹sub›
    • B) ‹sup› ✔
    • C) ‹top›
    • D) ‹up›

    Why: The ‹sup› tag writes text as superscript, above the normal line, as in x² or 10³. ‹sub› is used for subscript.

  14. Which tag creates a hyperlink?

    • A) ‹link›
    • B) ‹href›
    • C) ‹a› ✔
    • D) ‹url›

    Why: The anchor tag ‹a› makes links.

  15. Which attribute of ‹a› gives the destination address?

    • A) src
    • B) alt
    • C) link
    • D) href ✔

    Why: The href attribute holds the address the link points to, for example ‹a href="page.html"›. src is used for images and scripts.

  16. target="_blank" in a link makes it open:

    • A) In a new tab or window ✔
    • B) In the same tab
    • C) As a download
    • D) In print preview

    Why: _blank opens a new tab.

  17. Which tag inserts an image?

    • A) ‹image›
    • B) ‹img› ✔
    • C) ‹pic›
    • D) ‹src›

    Why: The ‹img› tag inserts an image. It needs the src attribute for the file location and should have alt text.

  18. The attribute giving the image file location is:

    • A) href
    • B) alt
    • C) src ✔
    • D) path

    Why: src (short for source) gives the location of the image file, for example ‹img src="photo.jpg"›. href is for links.

  19. The alt attribute of an image is used for:

    • A) Image alignment
    • B) Image size
    • C) Image border
    • D) Alternate text if the image does not load ✔

    Why: The alt attribute gives alternate text that is shown if the image does not load and is read aloud by screen readers.

  20. Which tag creates a numbered list?

    • A) ‹ol› ✔
    • B) ‹ul›
    • C) ‹li›
    • D) ‹nl›

    Why: ‹ol› means ordered list, which shows items with numbers or letters. ‹ul› is for bullets and ‹li› is each item.

  21. Which tag creates a bulleted list?

    • A) ‹ol›
    • B) ‹ul› ✔
    • C) ‹dl›
    • D) ‹bl›

    Why: ‹ul› means unordered list, which shows items with bullets. ‹ol› shows numbered items.

  22. Each item in a list uses:

    • A) ‹it›
    • B) ‹item›
    • C) ‹li› ✔
    • D) ‹td›

    Why: ‹li› means list item. It is used for each item inside both ‹ol› (numbered) and ‹ul› (bulleted) lists.

  23. In a table, ‹tr› defines a:

    • A) Column
    • B) Cell border
    • C) Caption
    • D) Row ✔

    Why: ‹tr› means table row. Cells are placed inside it using ‹td› for data or ‹th› for headings.

  24. A normal data cell in a table uses:

    • A) ‹td› ✔
    • B) ‹tr›
    • C) ‹th›
    • D) ‹tc›

    Why: ‹td› means table data and makes a normal cell. ‹th› makes a heading cell, which is bold and centred by default.

  25. A table header cell uses:

    • A) ‹td›
    • B) ‹th› ✔
    • C) ‹thead›
    • D) ‹head›

    Why: th = table header (bold, centred).

  26. To merge two cells across columns, use:

    • A) rowspan
    • B) cellpadding
    • C) colspan ✔
    • D) merge

    Why: The colspan attribute makes a cell stretch across two or more columns, for example colspan="2". rowspan stretches it down rows.

  27. To merge cells down two rows, use:

    • A) colspan
    • B) cellspacing
    • C) rowmerge
    • D) rowspan ✔

    Why: The rowspan attribute makes a cell stretch down two or more rows, for example rowspan="2". colspan stretches it across columns.

  28. Space between the cell border and its content is set by:

    • A) cellpadding ✔
    • B) cellspacing
    • C) border
    • D) margin-cell

    Why: cellpadding sets the space between a cell's border and its content. cellspacing sets the space between separate cells.

  29. HTML files are saved with the extension:

    • A) .doc
    • B) .html ✔
    • C) .xls
    • D) .exe

    Why: HTML files are saved with the .html (or .htm) extension so that browsers open them as web pages.

  30. A comment in HTML is written as:

    • A) // comment
    • B) /* comment */
    • C) ‹!-- comment --› ✔
    • D) # comment

    Why: HTML comments use ‹!-- --›.

  31. Which tag collects user input?

    • A) ‹input-box›
    • B) ‹table›
    • C) ‹frame›
    • D) ‹form› ✔

    Why: The ‹form› tag groups input controls such as text boxes, radio buttons and the submit button, and sends the data to a server.

  32. The input type that hides typed characters is:

    • A) password ✔
    • B) text
    • C) hidden-text
    • D) secret

    Why: ‹input type="password"› hides typed characters behind dots or stars, so others cannot read the password on screen.

  33. To choose only one option from a group, use:

    • A) Checkboxes
    • B) Radio buttons ✔
    • C) Text area
    • D) Submit button

    Why: Radio buttons with the same name let the user pick only one option, such as male or female. Checkboxes allow several choices.

  34. To select several options at once, use:

    • A) Radio buttons
    • B) Password box
    • C) Checkboxes ✔
    • D) Reset button

    Why: Checkboxes let the user select several options at once, such as several hobbies. Radio buttons allow only one choice.

  35. A drop-down list is created with:

    • A) ‹list›
    • B) ‹drop›
    • C) ‹ul›
    • D) ‹select› and ‹option› ✔

    Why: A drop-down list is made with ‹select›, and each choice inside it is an ‹option› tag.

  36. A multi-line text box is created with:

    • A) ‹textarea› ✔
    • B) ‹input type="text"›
    • C) ‹textbox›
    • D) ‹p›

    Why: ‹textarea› creates a box for several lines of text, such as a comment or address. ‹input type="text"› allows only one line.

  37. The form method that hides data from the URL is:

    • A) GET
    • B) POST ✔
    • C) PUT-URL
    • D) SEND

    Why: GET shows data in the URL; POST does not.

  38. CSS stands for:

    • A) Creative Style System
    • B) Computer Style Sheets
    • C) Cascading Style Sheets ✔
    • D) Colour Setting Script

    Why: CSS = Cascading Style Sheets.

  39. CSS is mainly used to control:

    • A) Database storage
    • B) Server security
    • C) Program compiling
    • D) Presentation and layout ✔

    Why: CSS (Cascading Style Sheets) controls how a page looks: colours, fonts, spacing and layout. HTML gives the structure.

  40. CSS written inside the style attribute of a tag is:

    • A) Inline CSS ✔
    • B) Internal CSS
    • C) External CSS
    • D) Linked CSS

    Why: Inline CSS is written inside a tag's style attribute, for example ‹p style="color:red"›. It affects only that one element.

  41. An external CSS file is linked using:

    • A) ‹style src›
    • B) ‹link rel="stylesheet"› ✔
    • C) ‹css›
    • D) ‹script›

    Why: An external CSS file is linked in the ‹head› with ‹link rel="stylesheet" href="style.css"›, so one file can style many pages.

  42. In CSS, the # symbol selects an element by its:

    • A) class
    • B) tag name
    • C) id ✔
    • D) attribute

    Why: In CSS, # selects an element by its id (for example #header), and a dot selects by class (for example .menu).

  43. In CSS, the . (dot) selects elements by:

    • A) id
    • B) tag
    • C) name
    • D) class ✔

    Why: Dot is the class selector.

  44. Which CSS property changes text colour?

    • A) color ✔
    • B) font-color
    • C) text-colour
    • D) fgcolor

    Why: The CSS property color sets the text colour, for example color: blue. There is no font-color property in CSS.

  45. Which CSS property changes text size?

    • A) text-size
    • B) font-size ✔
    • C) size
    • D) font-weight

    Why: font-size sets the size of text, for example font-size: 18px. font-weight sets how bold the text is.

  46. The language that adds interactivity to web pages is:

    • A) HTML
    • B) CSS
    • C) JavaScript ✔
    • D) SQL

    Why: JavaScript adds interactivity, such as responding to clicks and checking forms. HTML gives structure and CSS gives style.

  47. Software used to view web pages is a:

    • A) Web server
    • B) Compiler
    • C) Spreadsheet
    • D) Web browser ✔

    Why: A web browser such as Chrome, Firefox or Edge displays web pages. A web server stores and sends the pages.

  48. A website whose content is the same for every visitor is:

    • A) Static ✔
    • B) Dynamic
    • C) Interactive
    • D) Server-side

    Why: Static pages do not change.

  49. Renting space on a server to publish a website is called:

    • A) Web browsing
    • B) Web hosting ✔
    • C) Web crawling
    • D) Web mailing

    Why: Hosting keeps the site online.

  50. The World Wide Web was invented in:

    • A) 1969
    • B) 1975
    • C) 1989 ✔
    • D) 2001

    Why: Tim Berners-Lee proposed the WWW in 1989.

Loksewa Pathsala is an independent educational platform. It is not affiliated with the Public Service Commission (Lok Sewa Aayog) or the Government of Nepal. · लोक सेवा आयोगको आधिकारिक साइट होइन। · Sources & disclaimer
Scroll to Top