[SOLVED] Bootstrap 5 basic row test is not working

Issue

This Content is from Stack Overflow. Question asked by Mazen Mamdouh

I barely started learning bootstrap and I’m facing this problem, Bootstrap 5 basic row doesn’t seem to work like in the tutorial I’m learning from, Project structure:

index.html:

<!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" />
    <link rel="stylesheet" href="css/style.css" />
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
    <title>Test Document</title>
  </head>
  <body>
    <div class="row">
      <div>test</div>
      <div>test2</div>
      <div>test3</div>
      <div>test4</div>
    </div>

    <script src="js/main.js"></script>
    <script src="js/jquery-3.6.1.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.js"></script>
  </body>
</html>

the result I’m getting:



Solution

Try 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" />
    <link rel="stylesheet" href="css/style.css" />
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
    <title>Test Document</title>
  </head>
  <body>
    <div class="container">
        <div class="row">
            <div class="col">
              <span>test</span>
              <span>test2</span>
              <span>test3</span>
              <span>test4</span>
            </div>
        </div>
    </div>

    <script src="js/main.js"></script>
    <script src="js/jquery-3.6.1.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.js"></script>
  </body>
</html>


This Question was asked in StackOverflow by Mazen Mamdouh and Answered by Qrzysio It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?