by @kodeazy
CSS How to divide div into 4 equal coulmns without using any CSS frameworks like BOOTSTRAP?
- using
flex
propery we can divide the div into desired number of parts. -
Below is the
CSS
for dividing therow
into desired number ofparts
.<style> .row1{ display: flex; } .coulmn{ flex: 25%; } </style>
-
Below is sample code to divide
row
into desired number ofcoulmns
.<html> <head> <style> .row1{ display: flex; } .coulmn{ flex: 25%; } </style> </head> <body> <div class="row1"> <div class="coulmn">first</div> <div class="coulmn">Second</div> <div class="coulmn">Third</div> <div class="coulmn">fourth</div> </div> </body> </html>