Text preview & study summary
HTML and CSS Basics
A free sample of 5 questions from this quiz, shown in full with answer choices and explanations. No interactivity — everything is visible on this page for study and review.
Want to test your knowledge? Launch the Interactive Exam Simulator
Question 1
What does HTML stand for?
Explanation
HTML (HyperText Markup Language) is the standard markup language used to create the structure and content of web pages. "HyperText" refers to text that contains hyperlinks connecting documents; "Markup Language" refers to the system of tags used to annotate text with meaning. HTML is not a programming language — it does not contain logic or variables. The current standard is HTML5 (finalized 2014).
Question 2
What is the correct way to include an external CSS stylesheet in an HTML document?
Explanation
External CSS is linked using the `<link>` element inside the `<head>` section: `<link rel="stylesheet" href="styles.css">`. The `rel="stylesheet"` attribute tells the browser the relationship (it's a stylesheet); `href` specifies the file path. This is preferred over inline styles (style attribute) and embedded styles (`<style>` blocks) because it separates concerns, enables caching, and allows one stylesheet to style multiple HTML pages.
Question 3
Which CSS property controls the stacking order of positioned elements on a page?
Explanation
The `z-index` property determines the stacking order of elements along the Z-axis (towards/away from the viewer). Elements with a higher `z-index` value appear on top of elements with lower values. `z-index` only works on positioned elements (`position: relative`, `absolute`, `fixed`, or `sticky`) — it has no effect on static elements. Elements with the same `z-index` stack in source-code order (later elements appear on top).
Question 4
In CSS, what does the `:nth-child(2n+1)` selector match?
Explanation
The `:nth-child()` pseudo-class accepts an expression `An+B` where A is the cycle size and B is the offset. `2n+1`: when n=0: position 1; n=1: position 3; n=2: position 5; etc. — selecting all odd positions. This is equivalent to `:nth-child(odd)`. `2n` (or `even`) selects even positions. This selector is commonly used for alternating table row colors ("zebra striping"): `tr:nth-child(odd) { background: #f2f2f2; }`.
Question 5
Which HTML element defines the largest (most important) heading?
