Legend
These examples are used for automated tests and may not follow service manual best practice.
Legend default
Code
Markup
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--l">
<h1 class="nhsuk-fieldset__heading">
What is your address?
</h1>
</legend>
Macro
Legend with size S text
Code
Markup
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--s">
<h1 class="nhsuk-fieldset__heading">
What is your address?
</h1>
</legend>
Macro
Legend with size M text
Code
Markup
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--m">
<h1 class="nhsuk-fieldset__heading">
What is your address?
</h1>
</legend>
Macro
Legend with size L text
Code
Markup
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--l">
<h1 class="nhsuk-fieldset__heading">
What is your address?
</h1>
</legend>
Macro
Legend with size XL text
Code
Markup
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--xl">
<h1 class="nhsuk-fieldset__heading">
What is your address?
</h1>
</legend>
Macro
Legend with HTML
Code
Markup
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--l">
<h1 class="nhsuk-fieldset__heading">
What is your address?
</h1>
</legend>
Macro
Legend with HTML via call block
Open this example in a new tab: Legend with HTML via call block
Code
Markup
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--l">
<h1 class="nhsuk-fieldset__heading">
What is your address?
</h1>
</legend>
Macro
Legend without page heading
Code
Markup
<legend class="nhsuk-fieldset__legend">
What is your address?
</legend>
Macro
Legend with size class
Code
Markup
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--l">
<h1 class="nhsuk-fieldset__heading">
What is your address?
</h1>
</legend>
Macro
Legend with size class overriding size param
Open this example in a new tab: Legend with size class overriding size param
Code
Markup
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--l">
<h1 class="nhsuk-fieldset__heading">
What is your address?
</h1>
</legend>