Page structure
Ensure usability and accessibility by using a consistent HTML structure in pages and apps
Note
This document does not apply for widgets
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). -
Include the reset utility.
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. 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
The components above are expected to be placed like this:
<body>
<div class="kth-a11y-nav"></div>
<div class="kth-kpm"></div>
<header class="kth-header"></header>
<div class="kth-content">
<nav class="kth-breadcrumbs"></nav>
<aside></aside>
<main></main>
</div>
<footer class="kth-footer"></footer>
</body>