i have two navbars and i been trying to center the second navbars icons but its not working .When i aligned it left and right it works but once i do centre it doesnt work at all. Have i missed some part of code or made a mistake, therefore its not working. If anyone could help i would appreciate it.
thats the CSS code for my 2nd navbar:
.navbartwo {
overflow: hidden;
bottom: 0;
width: 100%;
}
.navbartwo {
background-image: url(nav.png)
}
.navbartwo a {
float: centre;
display: inline-grid;
color: #f2f2f2;
text-align: center;
padding: 14px 13px;
text-decoration: none;
font-size: 15px;
display: flex;
align-items: center;
}
/* links on hover */
.navbartwo a:hover {
background-color: #ddd;
color: black;
}
/*colour to the active/current link */
.navbartwo a.active {
color: #ebeef7;
}
.navbartwo.navbar-nav {
display: inline-block;
float: none;
vertical-align: top;
}
.navbartwo .navbar-collapse {
text-align: center;
}
This is the HTML:
<div class="navbartwo">
<a href="#Dashboard">
<svg id="try" xmlns="http://www.w3.org/2000/svg" width="70" height="70" fill="white" class="bi bi-house-door" viewBox="0 0 16 16">
<path d="M8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4.5a.5.5 0 0 0 .5-.5v-4h2v4a.5.5 0 0 0 .5.5H14a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146zM2.5 14V7.707l5.5-5.5 5.5 5.5V14H10v-4a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v4H2.5z" />
</svg>
<a href="#Map"><svg id="try" xmlns="http://www.w3.org/2000/svg" width="70" height="70" fill="white" class="bi bi-geo-alt" viewBox="0 0 16 16">
<path d="M12.166 8.94c-.524 1.062-1.234 2.12-1.96 3.07A31.493 31.493 0 0 1 8 14.58a31.481 31.481 0 0 1-2.206-2.57c-.726-.95-1.436-2.008-1.96-3.07C3.304 7.867 3 6.862 3 6a5 5 0 0 1 10 0c0 .862-.305 1.867-.834 2.94zM8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10z" />
<path d="M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 1a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" />
</svg></a>
<a href="#Analysis"><svg id="try" xmlns="http://www.w3.org/2000/svg" width="70" height="70" fill="white" class="bi bi-bar-chart-line" viewBox="0 0 16 16">
<path d="M11 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v12h.5a.5.5 0 0 1 0 1H.5a.5.5 0 0 1 0-1H1v-3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3h1V7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v7h1V2zm1 12h2V2h-2v12zm-3 0V7H7v7h2zm-5 0v-3H2v3h2z" />
</svg></a>
</svg></a>
<a href="#Community"><svg id="try" xmlns="http://www.w3.org/2000/svg" width="70" height="70" fill="white" class="bi bi-people" viewBox="0 0 16 16">
<path d="M15 14s1 0 1-1-1-4-5-4-5 3-5 4 1 1 1 1h8zm-7.978-1A.261.261 0 0 1 7 12.996c.001-.264.167-1.03.76-1.72C8.312 10.629 9.282 10 11 10c1.717 0 2.687.63 3.24 1.276.593.69.758 1.457.76 1.72l-.008.002a.274.274 0 0 1-.014.002H7.022zM11 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm3-2a3 3 0 1 1-6 0 3 3 0 0 1 6 0zM6.936 9.28a5.88 5.88 0 0 0-1.23-.247A7.35 7.35 0 0 0 5 9c-4 0-5 3-5 4 0 .667.333 1 1 1h4.216A2.238 2.238 0 0 1 5 13c0-1.01.377-2.042 1.09-2.904.243-.294.526-.569.846-.816zM4.92 10A5.493 5.493 0 0 0 4 13H1c0-.26.164-1.03.76-1.724.545-.636 1.492-1.256 3.16-1.275zM1.5 5.5a3 3 0 1 1 6 0 3 3 0 0 1-6 0zm3-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4z" />
</svg></a>
I have proceeded to put together this code snippet for you to review and use if this solves your issue. I would highly recommend to avoid using repetitive class rules in separate blocks, for example .navbartwo class being repeated several times, I joined all of the rules and added some new in order to make this works.
NOTE: You can remove the background color rule for the .navbartwo class. I placed it to visualize the icons since I don't have the current navbar background image at hand.
I certainly hope this helps you with your request. Happy coding and keep up the good work, you are doing great so far!