Skip to content Skip to sidebar Skip to footer

Divide A Row In 5 Columns In Bootstrap 4?

How do you equally divide a row in 5 columns in Bootstrap 4 where it has 12 columns total? Anyone knows?

Solution 1:

Bootstrap 4 doesn't use floats like version 3 did so it can automatically space out your columns using just the col class. So for 5 equally spaced columns, just do this:

.col1 {
  background-color: red;
}
.col2 {
  background-color: green;
}
.col3 {
  background-color: blue;
}
.col4 {
  background-color: orange;
}
.col5 {
  background-color: brown;
}
<linkrel="stylesheet"href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css"integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ"crossorigin="anonymous"><divclass="container"><divclass="row"><divclass="col col1">Column 1</div><divclass="col col2">Column 2</div><divclass="col col3">Column 3</div><divclass="col col4">Column 4</div><divclass="col col5">Column 5</div></div></div>

Post a Comment for "Divide A Row In 5 Columns In Bootstrap 4?"