I'm facing a challenge in vertically centering text in a button while also using SVG. The text is centered properly when the SVG is removed. How can I maintain the SVG size and still achieve vertical text centering?
https://i.sstatic.net/PJRtR.png
element.style {
}
button {
margin-right: 6px;
margin-bottom: 6px;
}
.imi-btn {
background-color: red;
border: 1px solid transparent;
padding: 0 15px;
height: 32px;
color: #fff;
border-radius: 4px;
display: flex;
cursor: pointer;
transition: 0.5s;
position: relative;
outline: none;
}
.imi-icon {
/* vertical-align: -0.05em; */
cursor: pointer;
display: inline-flex;
margin-right: 5px;
width: 17px;
height: 17px;
}
<button type="primary" class="imi-btn imi-btn-primary">
<designer-imi-icon>
<i class="imi-icon">
<svg height="100%" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg" fill="white"><path d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>
</i>
</designer-imi-icon>
My Event
</button>