Hong Kong Baptist University · FACULTY OF COMPUTER SCIENCE

AIDM7450 Chap.2 Responsive and Semantic Page Design

- one subject, every graph, every model, every mark
6 Chapters3-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 2 of 7 · AIDM7450

Responsive and Semantic Page Design

Meaning survives layout changes

This chapter compares CSS cascade order, selector reach and semantic container choice before turning to responsive layout. A section, article, aside, nav, header or footer is selected from what its content contributes, not from where it appears on screen.

The responsive method combines relative grids, fluid images and media queries so one document can change arrangement without changing meaning. Tables are reserved for real row-and-column relationships, while lists and generic containers handle different information structures.

The same content can appear as two columns on a wide display and one reading path on a narrow display.

That visual change should not reverse the document's logical order or turn complementary material into the main article. Relative widths describe relationships inside a container, fluid media prevents an image from forcing overflow, and a media query changes arrangement at the point the content becomes uncomfortable. Responsive design is therefore a coordinated system rather than one breakpoint rule.

In this chapter

What this chapter covers

  • 01

    Cascade order and repeated declarations

  • 02

    Contextual, class and ID selector reach

  • 03

    Lists, table rows and spanning cells

  • 04

    Semantic sections, articles, asides and navigation

  • 05

    Relative grids and fluid images

  • 06

    Content-driven media query breakpoints

Worked example · free

Repair a fixed exhibition layout

Q [9 marks]. AskSia-authored practice. A two-column exhibition page forces horizontal scrolling on a narrow screen. Preserve the content and reading order while making it responsive. The marks shown are an AskSia study allocation.
The cascade is a resolution path rather than a pile of styles.The cascade is a resolution path rather than a pile of styles. The stepped boxes show progressively closer declarations competing for one property.Follow the declarations toward the winnerBrowser defaultExternal sheetEmbedded ruleInline rulelater and morespecific rulesoverride conflicts
The cascade is a resolution path rather than a pile of styles. The stepped boxes show progressively closer declarations competing for one property.
  • 3Use a device-width viewport and relative container sizes.
  • 2Constrain media inside its container.
  • 4Stack the columns at a content-driven breakpoint.
This mark allocation structures independent practice and is not an official university assessment scheme. Set the viewport to follow the device, express the wrapper and columns relative to their context, and constrain images with max-width:100% and automatic height. Add a media query at the point where the columns become unreadable and stack them. Keep the article before its aside in document order so the narrow layout reads correctly without visual reordering.
Sia tip — Choose the breakpoint where the content stops working, not from the name of a popular device.
Glossary

Key terms

Cascade Order
The sequence through which competing CSS declarations are resolved for an element.
Semantic Element
An HTML element whose name expresses the role of its content.
Fluid Grid
A layout whose widths are relative to their containing context rather than fixed pixels.
Fluid Image
An image constrained to scale within the width of its container.
Breakpoint
A condition at which a media query changes the layout because the current arrangement no longer works.
FAQ

Responsive and Semantic Page Design FAQ

Why should semantic elements not be chosen from screen position?

Screen position can change at a responsive breakpoint while content responsibility remains stable. An aside is complementary because of its relationship to the main content, not because it appears on the right. Choose meaning first and let CSS control placement.

What makes a table appropriate?

A table is appropriate when readers need to compare values across rows and columns and the cells have genuine relationships. A list is better for sequence or grouping. A generic layout container is better when the arrangement is visual and carries no tabular meaning.

Which parts must cooperate in responsive design?

Relative grid sizes keep containers proportional, fluid media stays within those containers, and media queries change the arrangement when content becomes cramped. Omitting any one can leave fixed overflow, unreadably narrow columns or an image that forces horizontal scrolling.

Study strategy

Exam move

Take one wide layout and inspect it without CSS to verify reading order and semantic structure. Reapply the layout with relative widths, then narrow the viewport until the content becomes uncomfortable and place the breakpoint there. Test immediately above and below it, enlarge the text and verify images, tables and navigation still fit without losing meaning.

Create a second version that looks identical but uses generic containers, then explain which regions lose meaning when presentation disappears. Compare an article with a section by asking whether the content could stand alone outside the page; compare an aside with main content by asking what remains if the region is removed.

For layout calculations, state the containing block before converting a target width into a proportion, because a percentage inherits context rather than the entire screen. Inspect every image at the narrowest width and confirm it remains inside its container without distorted height.

Use a real row-and-column data set to practise rowspan and colspan, then rewrite a sequence as a list so the difference between data relationships and visual alignment becomes explicit. End with keyboard and enlarged-text checks around the breakpoint, not only a screenshot at one named device width.

Record the first width where each component fails and explain whether the repair belongs to the grid, the media itself, or the arrangement rule before adding another query.

Working through Responsive and Semantic Page Design in AIDM7450? Sia is AskSia’s AI Computer Science tutor — ask any AIDM7450 Responsive and Semantic Page Design question and get a clear, step-by-step explanation grounded in how AIDM7450 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 16 of your subjects at Hong Kong Baptist University, plus 1,000+ more Bibles across the AskSia library.
Sia - your AIDM7450 tutor, unlimited, worked the way the exam marks it
The full 3-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works