How to make a container width auto adapt to contained text

Hi there,

is there a way to make a container width automatically adapt to its contained text?

The container is in a GB element applied to several pages.
The text inside is taken from a custom field and each page has it’s own text string. Hence, the lenght for each string can vary.
The container has a visible border.

If I leave the container as it is, if the string is short, there is a lot of white space reminaing to the right of the string.
If I narrow the container width (adding some % padding to the right). When the string is long, the text goes on 2 or more rows.

Thank you. All the best. Carlo