图像未在 CSS 中垂直对齐 | HTML 和 CSS

问题描述

Image of the Website Footer

body {
    background-color: #222;
}

.minimal-footer {
    margin-left: 15%;
    color: #add8e6;
    font-family: 'Roboto Mono',monospace;
    list-style: none;
    font-size: 11px;
}

.text-wrapper {
    list-style: none;
    margin-top: 4%;
    margin-bottom: 4%;
    font-size: 12px
}


.text-wrapper li a {
    text-decoration: none;
    color: #add8e6;
}

.text-wrapper li a:hover {
    color: #fff;
    font-weight: bold; 
}
  <footer>
            <div class="minimal-footer">
                <ul class="text-wrapper">
                    <li><img src="img/creator.png" style="height: 16px;"><span class="footer-text"> Created by Obito</span></li>
                    <li><img src="img/creator.png" style="height: 16px;"><span class="footer-text"> Follow our <a href="twitter.com/ObitoFN">Twitter</a></span></li>
                    <li><img src="img/creator.png" style="height: 16px;"><span class="footer-text"> Check our other <a href="">Socials</a></span></li>
                    <li><img src="img/creator.png" style="height: 16px;"><span class="footer-text"> Support this <a href="">Project</a></span></li>
                </ul>
            </div>
        </footer>

我已经尝试在我的代码中垂直对齐文本和图像,附在上面,但我找不到解决方案。文本的顶部或底部总是有填充,不允许它与我想删除的图像居中。

解决方法

这应该可以解决问题:

.text-wrapper li {
    display: flex;
    align-items: center;
}