All subjects · Information Technology · WIT12 3 hour practical exam on web development with HTML, CSS and JavaScript
Block and inline elements and content models
Edexcel IAL Information Technology · WIT12 3 hour practical exam on web development with HTML, CSS and JavaScript
How an element sits on the page depends on whether it is block-level or inline, and what it may contain depends on its content model (spec 7.2.1 and 7.2.2).
Block-level and inline (7.2.1)
A block-level element starts on a new line and, by default, stretches to the full width available: <h1> to <h6>, <p>, <div>, <ul>, <ol>, <li>, <table>, <form>, <header>, <section>.
An inline element sits within the flow of text, only as wide as its content, without starting a new line: <a>, <span>, <em>, <strong>, <img>, <input>, <abbr>.
<p>Book a <strong>swimming</strong> lesson <a href="book.html">online</a>.</p>
<p>Each paragraph starts on a new line.</p>The strong and a elements stay inside the first line of text; each p starts on its own line. CSS can change this with the display property (display: block, inline or inline-block).
Content models (7.2.2)
HTML5 groups elements into content models (categories) that say where an element may go and what it may contain:
| Content model | Meaning | Examples |
|---|---|---|
| Flow | Most elements used in the body | p, div, ul, table, form, a, img |
| Sectioning | Elements that create a section with its own outline (headings belong to it) | article, section, nav, aside |
| Heading | Headings of a section | h1 to h6 |
| Phrasing | Text and the elements that mark up text inside a paragraph (mostly inline) | span, em, strong, a, img, abbr, input |
| Embedded | Content imported from another resource | img, audio, video, iframe, canvas |
| Interactive | Elements designed for the user to interact with | a (with href), button, input, select, textarea, label |
An element can belong to more than one model; img is flow, phrasing and embedded
Why it matters
A p element's content model is phrasing content, so a p cannot contain a block such as a div, ul or another p. Browsers silently close the p early, which breaks styling. Interactive content cannot be nested inside other interactive content: no button inside an a. Valid nesting is checked by a code validator (Topic 10).
Worked example
Explain what happens to the layout of this line: `<p>Prices: <span>Adult 5.00</span> <div>Child 3.00</div></p>`
- span is inline, so 'Adult 5.00' stays on the same line as 'Prices:'.
- div is block-level, so 'Child 3.00' starts on a new line and takes the full width.
- A p may only contain phrasing content, so the div is not allowed there: the browser ends the paragraph before the div, and the closing tag is left unmatched.
Answer: The div starts a new line and is invalid inside the paragraph; use an inline element such as span instead.
Check yourself
- Which of these elements is block-level by default?
- `<li>`
- `<span>`
- `<em>`
- `<a>`
Show answer
`<li>`. li is a block-level list item; span, em and a are inline.
- Describe how a block-level element is displayed by default.
Show answer
It starts on a new line and takes up the full width available.. Two features to give: it starts on a new line, and it takes up the full width available.
- Which content model does the video element belong to, as well as flow content?
- Embedded
- Heading
- Sectioning
- Metadata only
Show answer
Embedded. video imports media from another resource, so it is embedded content.
- Which of these is phrasing content that may go inside a p element?
- `<ul>`
- `<div>`
- `<table>`
- `<strong>`
Show answer
`<strong>`. strong marks up text within a paragraph: phrasing content. ul, div and table are block flow content and are not allowed inside p.
- Which content model includes button, select and a element with an href?
- Embedded
- Interactive
- Sectioning
- Heading
Show answer
Interactive. These are designed for the user to interact with.
- Which generic inline element is used to group words so that they can be styled, when no semantic element fits? Type its name without angle brackets.
Show answer
span. span is the generic inline container; div is the generic block container.
Sources
- Pearson Edexcel International Advanced Subsidiary/Advanced Level in Information Technology specification (first teaching 2018), Unit 2 Topics 7 to 11
- Pearson qualifications: Edexcel International Advanced Level Information Technology (2018)
Last updated 8 November 2026. Spotted a mistake? Tell us.