Your First Bootstrap Page

Bootstrap Framework 10 min min read Updated: Nov 16, 2026 Beginner
Your First Bootstrap Page
Beginner Topic 3 of 6

Create Your First Page

Now that you know how to add Bootstrap, let us build a real page. We will use the standard starter template that almost every Bootstrap project begins with.

Step 1: Create the File

  1. Create a new folder named bootstrap-course.
  2. Open it in VS Code.
  3. Create a new file called index.html.

Step 2: Paste the Starter Template

html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Hello Bootstrap</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <h1>Hello, Bootstrap!</h1> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js"></script> </body> </html>

Step 3: Understand Each Part

LinePurpose
<!DOCTYPE html>Tells the browser this is a modern HTML5 page. Bootstrap needs it to work correctly
<html lang="en">Sets the language, which helps search engines and screen readers
<meta charset="UTF-8">Allows all characters, including symbols and other languages
<meta name="viewport" ...>Makes the page responsive on mobile phones
<link ... bootstrap.min.css>Loads Bootstrap's styles
<script ... bootstrap.bundle.min.js>Loads Bootstrap's interactive features
Very important: Without the viewport meta tag, phones show a tiny zoomed-out desktop page, and Bootstrap's responsive layout will not work correctly.

Step 4: Add Some Content

Replace the <h1> line with this code to see more of Bootstrap in action:

html <div class="container mt-5"> <h1 class="text-primary">Welcome to Bootstrap</h1> <p class="lead">This is my first responsive page.</p> <a href="#" class="btn btn-success">Get Started</a> </div>

What Did We Use?

  • container centers the content and gives it side space
  • mt-5 adds a margin on the top (space above)
  • text-primary makes the text blue
  • lead makes the paragraph slightly larger
  • btn btn-success creates a green button
Result

A page with a big blue heading, a larger paragraph and a green Get Started button, all centered neatly.

Step 5: See It Responsive

Open index.html in your browser. Drag the edge of the window to make it narrower, or press F12 and click the phone icon. Notice that the container adapts to the screen width.

Common Mistakes

  • Forgetting rel="stylesheet" in the link tag
  • Saving the file as index.html.txt
  • Missing the closing </div> tag
  • Opening the wrong file in the browser
Practice: Change btn-success to btn-danger, btn-warning and btn-dark. Refresh and see the color change each time.

Conclusion

You now have a working Bootstrap page, and this template will be the base for almost every lesson. Keep the file; you will reuse it often.

Quick Summary: Use the starter template with the viewport meta tag, Bootstrap CSS in head, JS bundle at the end, and add content inside a container.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators