I found this interesting code snippet:
.float-left {
float: left !important;
}
.float-right {
float: right !important;
}
.container {
padding: 1rem;
}
.clearfix {
clear: both;
}
.has-border {
border: 2px solid #000;
}
.d-inline-block {
display: inline-block !important;
}
.align-middle {
vertical-align: middle !important;
}
<div class="has-border">
<div class="container">
<div class="div1 float-left">
Contact
</div>
<div class="div2 float-right">
<button class="d-inline-block">
Hey
</button>
<svg width="20" height="20">
<circle cx="10" cy="10" r="40"
stroke="green" stroke-width="4" fill="yellow" />
Sorry, your browser does not support inline SVG.
</svg>
</div>
<div class="clearfix"></div>
</div>
</div>
It's obvious that the button and svg are positioned next to each other but lack vertical alignment.
What is the best way to align the svg and button vertically while keeping them side by side?