[SOLVED] Text element styling

Is it possible to wrap around text-element (entity) in span or any other element and apply custom css?
I’m using text element in chat and my goal is to have something like this:
(Text is wrapped in rounded rectangles)
I could use image as a child but it lacks auto height width etc
What else could I use? Thanks

Hi @Newbie_Coder,

Yes, if you are talking about PlayCanvas element components the best thing would be to use a child with an image.

I think if you set the anchors of the child element to 0,0,1,1 it will automatically resize and follow the parent element size:

1 Like

In this case where you want the background to resize based on the size of the contents, you can set the text of the element and get the calculated width of the text element to change the width of the background elemetn.

1 Like

Thanks guys