You can set a max width to the text container. Make sure to use break word in the p tag.
.content-container {
float: left;
background: yellow;
max-width: calc(100% - 80px);
}
.content-container p{
word-wrap: break-word;
}
.item {
background: white;
width: 91%;
margin: 10px auto 0;
padding: 14px;
border-radius: 5px;
box-shadow: 0 0.5px 0 0 #ffffff inset, 0 1px 2px 0 #B3B3B3;
font-size: 14px;
color: #424242;
overflow: auto;
}
.content-container {
float: left;
background: yellow;
max-width: calc(100% - 80px);
}
.content-container p{
word-wrap: break-word;
}
.buttons {
float: right;
background: green;
}
<div class="item">
<div class="content-container">
<p>Buy groceries1111111111111111111111111111111111111111111111111111111111111111111111111</p>
</div>
<div class="buttons">
<button class="btn-done">
<i class="fa fa-check" aria-hidden="true"></i>
</button>
<button class="btn-delete">
<i class="fa fa-trash" aria-hidden="true"></i>
</button>
</div>
</div>
Edit
In order to vertically align the buttons, you can use the flex display, since you are using float. A new snippet is added. The changes are follows.
.item{
display: flex;
align-items: center;
}
.buttons {
float: right;
margin-left: auto;
background: green;
}
.item {
background: white;
width: 91%;
margin: 10px auto 0;
padding: 14px;
border-radius: 5px;
box-shadow: 0 0.5px 0 0 #ffffff inset, 0 1px 2px 0 #B3B3B3;
font-size: 14px;
color: #424242;
overflow: auto;
display: flex;
align-items: center;
}
.content-container {
float: left;
background: yellow;
max-width: calc(100% - 80px);
}
.content-container p {
word-wrap: break-word;
}
.buttons {
float: right;
margin-left: auto;
background: green;
}
<div class="item">
<div class="content-container">
<p>Buy groceries1111111111111111111111111111111111111111111111111111111111111111111111111</p>
</div>
<div class="buttons">
<button class="btn-done">
<i class="fa fa-check" aria-hidden="true"></i>
</button>
<button class="btn-delete">
<i class="fa fa-trash" aria-hidden="true"></i>
</button>
</div>
</div>