Navbar branding
The brand area shows your logo or name, usually on the left of the navbar.
In this page:
Syntax
<a class="navbar-brand" href="#">Brand text</a>
<span class="navbar-brand mb-0 h1">Brand text</span>
Navbar branding
Use .navbar-brand on an a element (or span for a non-link). It can hold text, an image sized with width and height attributes, or both. Vertical alignment inside the brand is easiest with .d-inline-block .align-text-top or flex utilities.
Note:
Give logo images alt text and explicit dimensions.
Example: Navbar branding
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="p-3">
<nav class="navbar bg-body-tertiary">
<div class="container">
<a class="navbar-brand d-flex align-items-center gap-2" href="#">
<svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><circle cx="15" cy="15" r="14" fill="#712cf9"/></svg>
<span>BrandName</span>
</a>
</div>
</nav>
</body>
</html>
Live Example
Related Topics
Common Mistakes
- Using a div instead of a link
- Huge unsized logo images
- Forgetting alt text
Chapter Summary
- navbar-brand holds text or logo
- Use a or span
- Size images explicitly
- Align with utilities
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: