How can I make the container div resize to fit its contents (content div)? I've tried but it doesn't seem to work.
Here's an example in example.html:
<html>
<head>
<link href="example.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<hr/>
<div class="container">
<div class="content">
lorem ipsum
</div>
</div>
<hr/>
</body>
</html>
In example.css:
.container
{
border-style: solid;
position: relative;
}
.content
{
border-style: dashed;
position: absolute;
}
Any insights on how to achieve this would be appreciated!