I'm facing a challenge that should be simple, but it's causing me some trouble. I have code that displays text on the left side and two buttons on the right side of the div.
These buttons use Bootstrap icons, which by default appear within a black border that doesn't look great.
When I try to remove the outline, there seems to be extra margin around the buttons, throwing off the formatting. I just want to remove the outline without affecting the layout.
btn:focus,
.btn:active {
outline: none !important;
box-shadow: none;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css">
<div style="display:flex; width:300px;">
<h5>Text</h5>
<div style="display:flex; margin-left:auto ">
<button title="Edit Links" class="btn btn-primary" type="button">
<i class="bi bi-gear-fill"></i>
</button>
<button title="Expand/Collapse" class="btn btn-secondary" type="button">
<i class="bi bi-arrows-expand"></i>
</button>
<div></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
The provided code applies CSS to remove the outline. But if I remove the CSS for the "btn" class, the button positions change noticeably.
My main goal is to get the buttons closer together. Any suggestions?
Here's what the code looks like without any CSS:
btn:focus,
.btn:active {
outline: none !important;
box-shadow: none;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css">
<div style="display:flex; width:300px;">
<h5>Text</h5>
<div style="display:flex; margin-left:auto ">
<button title="Edit Links" class="btn1" type="button">
<i class="bi bi-gear-fill"></i>
</button>
<button title="Expand/Collapse" class="btn1" type="button">
<i class="bi bi-arrows-expand"></i>
</button>
<div></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>