我有3张卡片,它们显示有关迁移,删除或存档的内容网站的信息。对于存档和删除的卡,Icon2位于信息div的顶部,但对于迁移的卡,它被向下推,不会位于顶部,因此它被推离卡的底部。为什么在我眼里他们都是一样的。我知道我有3里的迁移卡,但这应该没有关系。
<content id="template">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.13.0/css/all.css"
integrity="sha384-IIED/eyOkM6ihtOiQsX2zizxFBphgnv1zbe1bKA+njdFzkr6cDNy16jfIKWu4FNH" >
<style>
#Container {
width: 1200px;
/*border: 1px solid gold;*/
padding: 5px;
display: grid;
grid-template-columns: 2fr 2fr 2fr;
}
.Card {
border: 2px solid gray;
margin: 10px;
height: 150px;
transition: all .2s ease-in-out;
}
.Card:hover {
transform: scale(1.05);
border: 2px solid #6583ff ;
}
.Card:hover .Info {
border-left: 2px solid #6583ff;
}
.Card.Arc
{ background-color: #c6e2e9;
}
.Card.Mig
{ background-color: #f1ffc4;
}
.Card.Del
{ background-color: #ffcaaf;
}
.Icon {
text-align: center;
font-size: 3.5rem;
display: inline-block;
width:25%;
height:75px;
/*border: 1px solid red;*/
margin: 5px;
margin-top: 35px;
}
.Icon2 {
font-size: 2rem;
float: right;
border: 1px solid red;
position: relative;
}
.Info {
word-wrap: break-word;
font-size: 0.8rem;
display: Inline-block;
width: 63%;
height:90%;
border: 1px solid green;
margin: 5px;
padding-left: 10px;
border-left: 2px solid gray;
vertical-align: top;
}
</style>
<div id="Container">
{{#each . as |item|}}
{{#if _A}}
<div class="Card Arc">
<div class="Icon"><i class="fal fa-archive" style="color: #4d4d4d;"></i></div>
<div class="Info">{{Title}} - Archived
<li>Path to old site: {{Site_x0020_Address}}</li>
<li>Primary Contact: {{Site_x0020_Owners}}</li>
<div class="Icon2"><i class="fal fa-file-alt" style="color: #949494;"></i> </div>
</div>
</div>
{{/if}}
{{#if _M}}
<div class="Card Mig">
<div class="Icon"><i class="far fa-cloud-upload" style="color: #4d4d4d;"></i></div>
<div class="Info">{{Title}} - Migrated
<li>Path to old site: {{Site_x0020_Address}}</li>
<li>New Location: {{SPOnline_x0020_Site_x0020_Addres}}</li>
<li>Primary Contact: {{Site_x0020_Owners}}</li>
<div class="Icon2"><i class="fas fa-share" style="color: #949494;"></i></div>
</div>
</div>
{{/if}}
{{#if _D}}
<div class="Card Del">
<div class="Icon"><i class="fal fa-trash-alt" style="color: #4d4d4d;"></i></div>
<div class="Info">{{Title}} - Deleted
<li>Path to old site: {{Site_x0020_Address}}</li>
<li>Primary Contact: {{Site_x0020_Owners}}</li>
<div class="Icon2"><i class="fal fa-envelope" style="color: #949494;"></i></div>
</div>
</div>
{{/if}}
{{/each}}
</div>
What is happening
我想迁移的图标去的信息div顶部一样,他们的休息。
1条答案
按热度按时间2ekbmq321#
实际的问题是Card元素由于额外的li而溢出。
解决方案
使用
flex
布局,我只是将li和title Package 在名为Info-content的div中,并为Info元素添加display:inline-flex
规则。li必须始终位于ul或ol内