A dashboard layout helps organize information clearly so you can see important data at a glance.
Dashboard layout in Bootsrap
<div class="container"> <div class="row"> <div class="col-md-4">Content 1</div> <div class="col-md-4">Content 2</div> <div class="col-md-4">Content 3</div> </div> </div>
Use .container to center and add padding around your dashboard.
.row groups columns horizontally, and .col-md-* sets column width on medium+ screens.
<div class="container"> <div class="row"> <div class="col-md-6">Chart</div> <div class="col-md-6">Summary</div> </div> </div>
<div class="container"> <div class="row"> <div class="col-md-3">Menu</div> <div class="col-md-9">Main Content</div> </div> </div>
<div class="container"> <div class="row"> <div class="col-12 col-md-4">Widget 1</div> <div class="col-12 col-md-4">Widget 2</div> <div class="col-12 col-md-4">Widget 3</div> </div> </div>
This dashboard shows three key metrics in equal columns that stack on small screens. It uses Bootstrap's grid and spacing classes for a clean look.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Simple Dashboard</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <div class="container my-4"> <h1 class="mb-4">Sales Dashboard</h1> <div class="row g-3"> <div class="col-12 col-md-4"> <div class="p-3 border bg-light">Total Sales: $10,000</div> </div> <div class="col-12 col-md-4"> <div class="p-3 border bg-light">New Customers: 150</div> </div> <div class="col-12 col-md-4"> <div class="p-3 border bg-light">Orders: 320</div> </div> </div> </div> </body> </html>
Use Bootstrap's grid system to make your dashboard responsive automatically.
Use spacing classes like my-4 and g-3 to add space between elements.
Keep your dashboard simple and avoid clutter for easy understanding.
Dashboard layout organizes data clearly using rows and columns.
Bootstrap grid helps make dashboards look good on all screen sizes.
Use spacing and borders to separate dashboard sections visually.
Practice
Solution
Step 1: Understand Bootstrap grid basics
The Bootstrap grid system divides the page into rows and columns to arrange content neatly.Step 2: Relate grid to dashboard layout
Using rows and columns helps place charts and tables clearly, making data easy to read.Final Answer:
To organize content into rows and columns for clear display -> Option AQuick Check:
Grid layout = clear content organization [OK]
- Confusing grid with animations
- Thinking grid connects to databases
- Assuming grid changes colors
Solution
Step 1: Identify Bootstrap classes for layout
Therowclass defines a horizontal group of columns in Bootstrap.Step 2: Differentiate from other classes
containerwraps content,coldefines columns inside rows, andcardstyles content boxes.Final Answer:
<div class='row'> -> Option BQuick Check:
Row class = horizontal grouping [OK]
- Using container instead of row for rows
- Confusing col with row
- Using card class for layout rows
<div class='row'> <div class='col-6'>Chart A</div> <div class='col-6'>Chart B</div> </div>
How will the two charts appear on a large screen?
Solution
Step 1: Understand col-6 class meaning
Eachcol-6takes 6 out of 12 grid columns, so half the row width.Step 2: Analyze layout on large screen
Both columns fit side by side in the same row, each occupying half the width.Final Answer:
Chart A and Chart B appear side by side, each taking half the width -> Option CQuick Check:
col-6 + col-6 = side by side halves [OK]
- Thinking columns stack vertically by default
- Assuming overlap without floats
- Believing one column hides the other
<div class='row'> <div class='col-8'>Widget 1</div> <div class='col-6'>Widget 2</div> </div>
Solution
Step 1: Sum the column widths inside the row
Columns usecol-8andcol-6, totaling 14 (8+6).Step 2: Check Bootstrap grid rules
Bootstrap grid allows max 12 columns per row; exceeding causes wrapping or broken layout.Final Answer:
The total column widths exceed 12, causing layout issues -> Option AQuick Check:
Sum col widths > 12 breaks layout [OK]
- Ignoring total column width limit
- Thinking container is mandatory for rows
- Confusing row and col classes
Solution
Step 1: Understand responsive column classes
col-12makes full width on small screens;col-md-4makes one-third width on medium+ screens.Step 2: Apply to dashboard sections
Usingcol-12 col-md-4on each of three sections stacks them vertically on small devices and places side by side on desktops.Final Answer:
col-12 col-md-4 for each section -> Option DQuick Check:
Full width small + one-third medium = responsive layout [OK]
- Reversing small and medium classes
- Using fixed widths without responsiveness
- Choosing wrong breakpoint prefixes
Ready to prove it?
Pass the test and this pattern moves unknown
