I have a layout similar to:
I would like for the div to only exp
div
Try to use width: max-content property to adjust the width of the div by it's content size.
width: max-content
Try this example,
This div element has width 500px; Width by content size