I've been struggling with containing the text in my display area. No matter what I try, the text keeps overflowing and it's driving me crazy. I've researched various solutions like using word-wrap: break-word;
, adjusting width manually, but nothing seems to work. How can I make sure the text fits neatly inside the box's container?
- Note - The total is a result calculated based on user input
#total {
border-radius: 5px;
background-color: lightgrey;
width: 300px;
border: 15px solid green;
padding: 50px;
margin: 20px;
word-wrap: break-word;
}
<p id="total" style="position: absolute; right: 400px; width:200px; height: 200px; font-size: 10px;"></p>