.wrap {
white-space: nowrap;
}
input {
width: 100%;
}
body {
/* just so you can see it overflowing */
border: 1px solid black;
margin: 40px;
padding: 10px;
}
<span class="wrap"><input type="text">.pdf</span>
Observing the code snippet above, you'll notice that the ".pdf" extends beyond the container. How can this extension be prevented without specifying a fixed-width for the text?
The length of the ".pdf" text varies and cannot be manually defined.