How to calculate width of content in div (made by createDiv())?

edited January 2015 in p5.js

Hi,

I made some div elements using the createDiv() function, and filled them with html.

It seems that the created divs have the same width as my canvas, but I want them to only be as wide as content they contain. How can I calculate the width of the content contained by the div, so I can then resize the div to the correct width?

Thanks, Miles

Answers

Sign In or Register to comment.