How could I prevent this text to jump into a new row and make it overflow into the margin? I’ve tried with text-overflow but it does not seem to work..Ideally it would appear overflowed from the left margin and disappear into the right margin. Any suggestions perhaps?
.section-overflow {
background-color: green;
font-size: 2rem;
text-overflow: clip;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="section">
<p class="section-overflow">Lorem - Ipsum Lorem - Dorem - Lorem Ipsum - Lorem Dorem Ipsum - Lorem - Dorem - Lorem Ipsum </p>
</div>
</div>
</div>
2
Answers
You probably want to add
white-space: nowrap;
to your CSS. I would also change yourtext-overflow: clip;
tooverflow: hidden;
:Here is the JSFiddle: https://jsfiddle.net/t2fh3wmo/