I am facing an issue with a "message" element that needs to be resized if the text exceeds its width within certain limits, similar to how it works in messaging applications.
.message {
position: relative;
color: white;
background: #182533;
border-radius: 10px;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 10px;
margin-left: 70px;
margin-bottom: 10px;
top: 40px;
left: -10px;
max-width: 320px;
min-width: 70px;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
<div class="message">
</div>
Why does it still have the max width even when it's empty?
Here is how it currently looks like: https://i.sstatic.net/b4fNf.png
And here is how it should look like: https://i.sstatic.net/j3HcH.png