I'm facing a challenge with my code that consists of 8 bootstrap row elements. I want these rows to have equal height so that when combined, their height is equal to the screen height. Additionally, I need all the rows to be visible without any scrolling. I've tried setting the height for each row using h-100/50/25
, but this results in the rows overflowing the page. Customizing the height also didn't work. Any suggestions on how I can achieve this?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Equal rows</title>
<!-- Bootstrap core CSS -->
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bedcd1d1cacdcaccdfcefe8b908c908d">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<!-- Custom styles for this template -->
<link href="css/styles.css" rel="stylesheet">
</head>
<body class="text-center">
<div class="container-fluid vh-100">
<div class="row">
<div class="col-lg" style="background-color: lightcoral;">
<h3 style="color: white">lightcoral</h3>
</div>
</div>
<div class="row">
<div class="col-lg" style="background-color: indigo;">
<h3 style="color: white">indigo</h3>
</div>
</div>
<div class="row">
<div class="col-lg" style="background-color: red;">
<h3 style="color: white">red</h3>
</div>
</div>
<div class="row">
<div class="col-lg" style="background-color: lightseagreen;">
<h3 style="color: white">;ightseagreen</h3>
</div>
</div>
<div class="row">
<div class="col-lg" style="background-color: green;">
<h3 style="color: white">green</h3>
</div>
</div>
<div class="row">
<div class="col-lg" style="background-color: yellow;">
<h3 style="color: white">yellow</h3>
</div>
</div>
<div class="row">
<div class="col-lg" style="background-color: purple;">
<h3 style="color: white">purple</h3>
</div>
</div>
<div class="row">
<div class="col-lg" style="background-color: orange;">
<h3 style="color: white">orange</h3>
</div>
</div>
</div>
</body>
</html>