简体   繁体   English

对齐div中的多个图像

[英]Aligning multiple images in div

<div class="title" >
    <div class="issues"> <h2>Issues</h2></div>
        <div class="dropdown"> 
            <span class="filter"><h3>Filter</h3></span> 
            <span class="project"><h3>Project</h3></span>  
            <img src="down-arrow.png" style="height: 13px;">
            <img src="Grid.svg" style="margin-left: 13px;">
            <img src="List deactivated.svg" style="height: 13px;">
        </div>

I want the last two image with height 15px to align with all the elements of div.When I try doing so,all other elements move out of div and it gets distorted.Given below is my css code.我希望最后两个高度为 15px 的图像与 div 的所有元素对齐。当我尝试这样做时,所有其他元素都会移出 div 并且它会变形。下面是我的 css 代码。

 .title{
    margin-left: 192.5px;
    background: transparent;
    padding: 10px 0;
}
h3{
  display: inline;
}
.dropdown{
  margin-left: 76%;
  margin-top: -50px;
}

You can try to use Flexbox .您可以尝试使用Flexbox For example:例如:

 .dropdown { display: flex; align-items: center; justify-content: center; }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM