Is it possible to have a user add entries to a search bar without them overflowing the parent div container with the class kitchen? I am looking for a way to limit the number of li elements that can be added to prevent overflow, and I am unsure of what language to use for this. Is setting overflow: scroll the only solution?
I am curious if this can be achieved and what coding language would be required, or if setting overflow: scroll is the only option.
ul{
list-style-type: none;
height: 300px;
}
li{
float: left;
margin-bottom: 2px;
display: inline-block;
color: #FFFFFF;
border: solid 2px #FFFFFF;
padding: 1rem;
background: #222222;
width: 50%;
border-radius: 10px;
}
.fa-check-circle{
color: green;
}
.fa-edit{
color: red;
}
.row {
position: relative;
display: flex;
flex-direction: row;
}
.kitchen{
color: black;
background: url('../img/refrigerator.jpg');
background-size: cover;
background-position: 50%;
border: solid 5px #FFFFFF;
padding: 3rem;
height: 100%;
}
.col{
width: auto;
}
.lunchbox{
background: url('../img/lunchbox.jpg');
background-size: cover;
background-position: 50%;
display: inline-block;
border: solid 5px #FFFFFF;
padding: 3rem;
width: 100%;
height: 100%;
}
.column{
flex: 1;
margin-top: 3rem;
margin-right: 3rem;
margin-left: 3rem;
height: 600px;
}
<div class="kitchen">
<ul class="col">
<li>Apple<span class="far fa-check-circle"></span><span class="far fa-edit"></span></li>
<li>Cheese <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Cereal <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Ice Cream <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Steak <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Orange <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Apple<span class="far fa-check-circle"></span><span class="far fa-edit"></span></li>
<li>Cheese <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Cereal <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Ice Cream <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Steak <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Orange <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Apple<span class="far fa-check-circle"></span><span class="far fa-edit"></span></li>
<li>Cheese <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Cereal <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Ice Cream <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Steak <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
<li>Orange <span class="far fa-check-circle"></span> <span class="far fa-edit"></span></li>
</ul>
<button type="button" class="clear_btn">clear items</button>
</div><!--kitchen-->