I made 4 boxes and want to hide the third one with jQuery. When I do that, the fourth one moves next to the second one, but that's not what I want. I want the fourth one to stay where it is. What should I do?
$('.list_ch3').click(function(){
$('.list_ch3').hide('slow');
});
.list {
display:flex; flex-direction:
}
.list li{
list-style: none;
background-color: pink;
color: white;
font-weight: 800;
margin-left: 15px;
padding: 8px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<ul class="list" >
<li class="list_ch1">list item 1</li>
<li class="list_ch2">list item 2</li>
<li class="list_ch3">list item 3</li>
<li class="list_ch4">list item 4</li>
</ul>