Forum How do I...?

Using the Title of a document

Jellby
Is there a way to access the <title> element of an HTML file? I would like that for processing multiple files, and use the title of each HTML as the page header.
mikeday
You can capture it with string-set:
title { string-set: page-title content() }

Then reuse it in the page header:
@page { @top { content: string(page-title) } }
Jellby
Doh! As easy as using "title" as any other element in the CSS... :roll:

Thanks!