Images
These examples are used for automated tests and may not follow service manual best practice.
Images default
Open this example in a new tab: Images default
Code
Markup
<figure class="nhsuk-image">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="">
<figcaption class="nhsuk-image__caption">
No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
</figcaption>
</figure>
Macro
Code
Markup
<figure class="nhsuk-image nhsuk-u-width-one-quarter">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>
Macro
Code
Markup
<figure class="nhsuk-image nhsuk-u-width-one-third">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>
Macro
Code
Markup
<figure class="nhsuk-image nhsuk-u-width-one-half">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>
Macro
Code
Markup
<figure class="nhsuk-image nhsuk-u-width-two-thirds">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>
Macro
Code
Markup
<figure class="nhsuk-image nhsuk-u-width-three-quarters">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>
Macro
Code
Markup
<figure class="nhsuk-image nhsuk-u-width-full">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>
Macro
Images with custom HTML
Open this example in a new tab: Images with custom HTML
Code
Markup
<figure class="nhsuk-image">
<img src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="">
<figcaption class="nhsuk-image__caption">
No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
</figcaption>
</figure>
Macro
Images without background
Open this example in a new tab: Images without background
Code
Markup
<figure class="nhsuk-image nhsuk-image--no-background">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="">
<figcaption class="nhsuk-image__caption">
No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
</figcaption>
</figure>
Macro
Images without background, border or caption
Open this example in a new tab: Images without background, border or caption
Code
Markup
<figure class="nhsuk-image nhsuk-image--no-border nhsuk-image--no-background">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="A person in a bright pink athletic top, listening to music, pauses for thought during a short training session.">
</figure>
Macro
Images without border
Open this example in a new tab: Images without border
Code
Markup
<figure class="nhsuk-image nhsuk-image--no-border">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-exercise.jpg" alt="">
<figcaption class="nhsuk-image__caption">
No specific amount of time is recommended, but a typical training session could take less than 20 minutes.
</figcaption>
</figure>
Macro
Code
Markup
<figure class="nhsuk-image">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-stretch-marks-1000w.jpg" alt="Close-up of a person's tummy showing a number of creases in the skin under their belly button. Shown on light brown skin.">
</figure>
Macro
Images with srcset
Open this example in a new tab: Images with srcset
Code
Markup
<figure class="nhsuk-image">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg" alt="" sizes="(max-width: 768px) 100vw, 66vw" srcset="/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg 600w, /nhsuk-frontend/assets/example-image-stretch-marks-1000w.jpg 1000w">
<figcaption class="nhsuk-image__caption">
Stretch marks can be pink, red, brown, black, silver or purple. They usually start off darker and fade over time.
</figcaption>
</figure>
Macro
Images with srcset and alt text
Open this example in a new tab: Images with srcset and alt text
Code
Markup
<figure class="nhsuk-image">
<img class="nhsuk-image__img" src="/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg" alt="Close-up of a person's tummy showing a number of creases in the skin under their belly button. Shown on light brown skin." sizes="(max-width: 768px) 100vw, 66vw" srcset="/nhsuk-frontend/assets/example-image-stretch-marks-600w.jpg 600w, /nhsuk-frontend/assets/example-image-stretch-marks-1000w.jpg 1000w">
<figcaption class="nhsuk-image__caption">
Stretch marks can be pink, red, brown, black, silver or purple. They usually start off darker and fade over time.
</figcaption>
</figure>