Page structure
Ensure usability and accessibility by using a consistent HTML structure across pages
Note
This document does not apply for widgets
HTML metadata and head
-
Write the page language in the
<html>
tag. Usesv
for Swedish anden
for English. Read more about guidelines for page language in webbriktlinjer.se (in Swedish)<html lang="sv"></html>
-
Write a relevant page title using the
<title>
tag. Read more about guidelines for page titles in webbriktlinjer.se (in Swedish).
HTML body
The body
of a KTH page or application should have the following parts:
- A11y nav component. Defines links for keyboard users (for example “Skip to main content”)
- KPM. Defines the region for the entrances and Personal menu.
- Entrances. Link to kth.se, intranet and student web
- Personal menu. Links to relevant pages for the user
- Header. (
<header>
) Should be the same across all pages under the same site. It is divided into: - Content. Everything in between the header and the footer. This content can change between pages in the same site.
- Breadcrumbs
- Sidebar (
<aside>
) - Main content (
<main>
)
- Footer. Should be the same across all pages under the same site.
Minimal template
Place the components mentioned before like this:
<body>
<div class="kth-a11y-nav"></div>
<div class="kth-kpm"></div>
<header class="kth-header"></header>
<div class="kth-main-content">
<nav class="kth-breadcrumbs"></nav>
<aside></aside>
<main></main>
</div>
<footer class="kth-footer"></footer>
</body>
CSS
- Include the reset utility
- Include all CSS required by all components