I'm relatively new to css and I'm attempting to create a border around a <div>
. My goal is for the border to be limited to the size of the elements inside the div
and adjust dynamically in proportion to any new objects that may appear or disappear within the div.
I've experimented with using border-radius:
and the em
unit, but so far, I haven't made much headway. I've referred to resources like this and this, but I'm still looking for something akin to window.pack() in Java. My tools include css, javascript, and jquery, though it shouldn't matter much as the html is predominantly written through ejs.
Currently, the code I have just generates a box spanning the width of the page:
{
border-style: solid;
border-color: blue;
border-radius: 1-4 length|% / 1-4 length|%;
}