I want my layer to be as wide and as tall as the (styled) html content inside of it. Is this possible? Got to mention: the display property of the div class in the html is set to 'inline-block', so the div's wrap around the content (and the content differs all the time). See the picture below for an example.
EDIT: Solved the problem myself. Utils.textSize did the job.