The text isnt shrinking to fit the div box, it is overflowing instead
Expecting the text to shrink to fit the div box
div {
display: inline-block;
width: 60px;
height: 12px;
}
p {
display: inline-block;
width: auto;
height: auto;
text-align: center;
}
<div>
<p>Reading List</p>
</div>
2
Answers
Deny wrapping (white-space: nowrap;) for p tag
Change height for div. because 12px is too little
Add overflow: hidden; for div
Optional. Change padding and margin