On mobile devices the header text escapes from div wrapper. How can I prevent it? It only happens when the are 2 characters left. And if possible make it only with pure CSS (jQuery if needed).
HTML (Laravel-Blade)
@section('content')
@if($builds)
@foreach($builds as $result)
<div class="col-md-4">
<div class="builds">
<img src="{{ $result->icon }}" class="img-responsive" alt="Hero icon" />
<div class="text">
<h2>{{ $result->name }} - {{ $result->build }}</h2>
<i><span class="usercolored">{{ $result->created_by }} </span>,{{ date('d-m-Y', strtotime($result->date)) }} <br /> {{ $result->views }} zobrazení</i><br />
<button class="btn btn-primary btn-md">Přejit na build</button>
</div>
</div>
</div>
@endforeach
@else
<p>Nic nenalezeno</p>
@endif
@endsection
CSS
.builds {
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
height: 191px;
margin-top: 10px;
}
.builds h2{
margin: 0;
}
.builds:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}
.builds img {
width: 171px;
height: 191px;
float: left;
}
.builds .text {
margin-left: 180px;
}
I've created an example for you to understand how it works. Examples are good for an unusually long word inside a relatively small container which won't fit.
try this