After another revision**
If you're looking to customize the layout of your elements, one easy way is by applying a flex property to the parent element. This will only affect the immediate children below it, like the cell
class in this example where I've added borders for visual demonstration:
<div class="parent">
<div class="cell">
<div class="b"></div>
</div>
<div class="cell">
<div class="b"></div>
</div>
<div class="cell">
<div class="b"></div>
</div>
<div class="cell">
<div class="b"></div>
</div>
<div>
.parent {
display: flex;
width: 70%;
}
.cell {
width: 20%;
height: 100px;
border: 1px solid orange;
}
You can control the width of the parent element as well as its children with the above code snippet, ensuring consistency across the board while maintaining flexibility within the parent's boundaries.
** Alternatively, consider this streamlined approach utilizing different classes to adjust sizing preferences:
Here's an example showcasing varying sizes using distinct classes:
<div class="parent">
<div class="a"></div>
<div class="b"></div>
<div class="c"></div>
<div>
.parent {
display: flex;
width: 80%;
height: 100px;
}
.a {
flex: 40%;
border: 1px solid greenyellow;
}
.b {
flex: 20%;
border: 1px solid orange;
}
.c {
flex: 20%;
border: 1px solid blue;
}
Feel free to consolidate these classes into one if preferring uniformity or modify them individually for unique styling - hope this clarifies the concept for you!