Headline background color length?

Hi,

I want to make some headlines like the example in the attached image, but if I add a background color to a headline, the background color will fill the width of the page. Is there a way to make the background color adapt to the text length - like with the button element?

Skærmbillede 2026-04-13 kl. 14.25.57

Hey @Kobber,

Headlines are design to be block elements meaning they expand the width of their parent or container. You will need custom CSS to make the Headline element display inline. The following code, when added to the Headline Element CSS, will achieve that.

$el.x-text-headline {
  display: inline-block;
}

Please just note that custom coding is not included in our product support. The provided code only serves as a guide or to show that you can extend the design beyond the features offered in the builder. If you need more custom code, you can subscribe to our One service.