Reputation: 99
I have the following issue, if I minimize the browser width, the spans are out of the div:
How can I change the line automatically (without using br)? Like:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<div class="row">
<div class="bg-danger col-12 col-md-4 col-xl-3 p-5 mb-3">
<div class="row">
<div class="row">
<div class="col d-flex justify-content-start flex-column">
<span>[email protected]</span>
</div>
</div>
<div class="row">
<div class="col d-flex justify-content-start flex-column">
<span>[email protected]</span>
</div>
</div>
</div>
</div>
</div>
Upvotes: 0
Views: 43
Reputation: 6832
Use word-break: break-all
CSS property.
.break-words {word-break: break-all}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<div class="row">
<div class="bg-danger col-12 col-md-4 col-xl-3 p-5 mb-3">
<div class="row">
<div class="row">
<div class="col d-flex justify-content-start flex-column break-words">
<span>pepasdasdsadaiadtoadsasdasssssssda23pepasdasdsadaiadtoadsasdasssssssda23@gmail.com</span>
</div>
</div>
<div class="row">
<div class="col d-flex justify-content-start flex-column">
<span>[email protected]</span>
</div>
</div>
</div>
</div>
</div>
Upvotes: 3