Your primary issue arises from the fact that you had set the <li>
to a narrow width unnecessarily:
.navbar > .navbar-logo {
width: 75px;
height: 75px;
}
Simply remove those width and height declarations. They are not required. Instead, allocate the width and height values to the SVG element.
.navbar > .navbar-logo > svg {
width: 75px;
height: 75px;
vertical-align: top;
}
The vertical-align
directive ensures text alignment with the top of the SVG. Additionally, we assign line-height: 75px;
to the text so it vertically centers itself with the SVG automatically.
Final Outcome
(After removing some unnecessary elements)
.navbar {
height: 95px;
margin: 0;
padding-left: 50px;
padding-right: 50px;
box-shadow: 0 3px 4px grey;
list-style-type: none;
}
.navbar > .navbar-logo {
margin: 10px;
float: left;
font-family: 'Oswald', sans-serif;
font-size: 50px;
line-height: 75px;
}
.navbar > .navbar-logo > svg {
width: 75px;
height: 75px;
vertical-align: top;
}
.logo-compass-frame {
fill: none;
stroke: black;
stroke-width: 20;
stroke-linecap: round;
stroke-miterlimit: 10;
}
.logo-compass-north, .logo-compass-south {
stroke: black;
stroke-width: 8;
stroke-miterlimit: 10;
}
.logo-compass-south {
fill: none;
}
.logo-compass-center {
fill: black;
stroke: black;
stroke-width: 3;
stroke-linecap: round;
stroke-miterlimit: 10;
}
<ul class="navbar">
<li class="navbar-logo">
<svg x="0px" y="0px" viewBox="0 0 272.6 272.6">
<circle class="logo-compass-frame" cx="136.3" cy="136.3" r="105.8"></circle>
<polygon class="logo-compass-north" points="138,63.6 123.8,110.5 138,134.5 152.2,110.5"></polygon>
<polygon class="logo-compass-south" points="138,209 152.2,162.1 138,138.1 123.8,162.1"></polygon>
<circle class="logo-compass-center" cx="138" cy="136.6" r="5.7"></circle>
</svg>
<span>Text</span>
</li>
</ul>