Reputation: 69
I have this site at the moment with this code:
<body>
<nav class="navbar bg-primary">
<div class="container-inline navbar-brand">
<img src="img/logo.png"width="55">
<a class="text-light">Test</a>
</div>
<a class="nav-link text-light">One</a>
<a class="nav-link text-light">Two</a>
<a class="nav-link text-light">Three</a>
<a class="nav-link text-light">Four</a>
</nav>
<h1>Hello</h1>
</body>
I want there to be some more spacing between the text "Test" and the logo image, I have tried this such as ml-3
and pl-3
and similar, however none of those seem to be working.,
Upvotes: 0
Views: 1324
Reputation: 362430
There is no longer ml-*
in Bootstrap 5. It's been replaced with ms-*
. Read about the changes from Bootstrap 4 to Bootstrap 5.
<div class="container-inline navbar-brand">
<img src=".." width="55">
<a class="text-light d-inline-block ms-3">Test</a>
</div>
Upvotes: 0
Reputation: 1
On the div for the image you could add a mr-5
<div class="container-inline navbar-brand mr-5">
<img src="img/logo.png"width="55">
<a class="text-light">Test</a>
</div>
If you don't need too much space that should work. mr ranges from 1-5 so adjust as you see fit.
Upvotes: 0
Reputation:
You can use margin property and padding property of image and make sure to confirm the margin or padding when the display size changes . I think youre trying to make responsive as well so margin of px doesn
t change with display size . you`re using bootstrap right.
class="navbar-brand"
Add class to your image this will give you right margin .
Upvotes: 0
Reputation:
Apply style with margin property to your img element, u can adjust the pixel
<img src="img/logo.png" width="55" style="margin-right:20px">
Upvotes: 2