this is my example I need to implement a method in which it will be possible to allocate from 1 to 4 cells either horizontally or vertically Can anybody helps me?)
I was looking this question but i dont understant how can i improve it to my example:)
.custom {
display: table;
margin: 15% auto 15% auto;
width: 75%;
max-height: 75%;
background-color: aqua;
border: 4px double black;
}
.custom-cell {
position: relative;
width: 25%;
float: left;
height: 25%;
padding-bottom: 25%;
background: radial-gradient(red, black)
}
.custom-cell-clicked {
position: relative;
width: 25%;
float: left;
height: 25%;
padding-bottom: 25%;
background: radial-gradient(black, red)
}
<div class="custom">
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
<div class="custom-cell"></div>
</div>