It's all about a div size!

Hello guys!

I’m trying to style a div (a) to “auto” width based on the inner content, but this div (b) is inside another div with width: 98vw.

Could someone help me to do this magic?

Or even if someone knows how to center this B div without nesting it in another div… I will be grateful!


Hi again… I solved this issue and I will share how I did it in case of someone meet the same issue:

document.getElementByClassName("YOUR ELEMENT CLASS").style.width = (7 * "YOU CONTENT".length) + 'px';