我试图使所有元素都保持一行。这是代码
.logoHeader{
width:10vw;
display:inline;
}
ul li{
display: inline-flex;
}
span{
font-size:0.5em;
}
.myClass {
display: inline-flex;
}
<div class="myClass"><img class="logoHeader" src="https://s.imgur.com/desktop-assets/desktop-assets/Navbar-logo.bcf646386406b43008da913e901b916d.svg" width="500" height="53" alt="">
<ul>
<li><h5><span>A</span>Put Iva Vizina 165</h5></li>
<li><h5><span>T</span>T +382 69 710 025</h5></li>
<li><h5><span>Random Crap</span> Plaforma, 2018</h5></li>
</ul>
</div>
所以我需要整个列表项与徽标一起对齐
答案 0 :(得分:1)
在align-item: center
元素上使用.myClass
:
.logoHeader {
width: 10vw;
display: inline;
}
ul li {
display: inline-flex;
}
span {
font-size: 0.5em;
}
.myClass {
display: inline-flex;
align-items: center;
}
<div class="myClass"><img class="logoHeader" src="https://s.imgur.com/desktop-assets/desktop-assets/Navbar-logo.bcf646386406b43008da913e901b916d.svg" width="500" height="53" alt="">
<ul>
<li>
<h5><span>A</span>Put Iva Vizina 165</h5>
</li>
<li>
<h5><span>T</span>T +382 69 710 025</h5>
</li>
<li>
<h5><span>Random Crap</span> Plaforma, 2018</h5>
</li>
</ul>
</div>