I was using the first header from bootstrap’s examples: https://getbootstrap.com/docs/5.3/examples/headers/#
And I have this:
<div class="container fixed-top bg-white">
<header class="d-flex flex-wrap justify-content-center py-3 mb-4">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto link-body-emphasis text-decoration-none">
<svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"/></svg>
<span class="fs-4">Portfolio</span>
</a>
<ul class="nav nav-pills">
<li class="nav-item"><a href="#" class="nav-link active" aria-current="page">Home</a></li>
<li class="nav-item"><a href="#" class="nav-link">Features</a></li>
<li class="nav-item"><a href="#" class="nav-link">Pricing</a></li>
<li class="nav-item"><a href="#" class="nav-link">FAQs</a></li>
<li class="nav-item"><a href="#" class="nav-link">About</a></li>
</ul>
</header>
</div>
How do I have the top and bottom space equal?
Thank you,
2
Answers
IF you want to make it smaller remove the padding, I recommend adding py-3 to div above header.
adjust the py-3(padding y axis) to lower values to make it even smaller.
WIthout padding how it looks
use that bit of code inside your header to see the containers/layouts separately, then you will understand whats happening, at least thats how I do it.
So once you see the sections properly you can figure it out.
and once your done remove the border.
In this line
mb-
means margin-bottom. So, you can either removemb-4
or change it tomy-4
(margin-block). You can also make the margin bigger or smaller by changing the number from 0 to 5You will find more details here: https://getbootstrap.com/docs/5.3/utilities/spacing/