I am looking for a way to ensure that the content within a div container remains neatly contained without overflowing. How can I make the container responsive so that it adjusts its size based on dynamic text?
.element {
display: inline-block;
text-indent: 15px;
background-color: #0074d9;
width: 120px;
margin-right: 5px;
/* left and right margin of flex elements inside this element container */
margin-left: 5px;
animation: roll 3s infinite;
transform: rotate(30deg);
opacity: .5;
}
@keyframes roll {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
<div class="element">
<p>Welcome!</p>
<p>${user_name}</p>
<p>${user_email}</p>
<p>${user_contact} </p>
</div>