【发布时间】:2020-08-28 20:11:53
【问题描述】:
我正在尝试在 vue.js 项目中使用 Bulma 和 flexbox 使图标和文本居中,我尝试遵循这个问题 (How to vertically center elements in Bulma?) 的答案。我的图标垂直居中,但文本元素似乎偏离中心,下方有几个像素的空白。它们都在同一基线上,但意味着它们与我的图标不符(见下图)。
我不确定我哪里出错了,我已经在下面包含了我的代码,如果有任何帮助,我将不胜感激
<template>
<div class="singleProjectContainer" :key="project.id">
<ul class="columns is-flex projectPreview" style="border-bottom: 0.5px solid #c1c1c1;">
<div class="column is-1 is-flex projectIcon">
<li>
<div v-if="project.projectType === 'Identity'"class="projectIcon" >
<img src="../static/SVG/Identity-Circle.svg" alt="circle icon for branding & identity" />
</div>
</li>
</div>
<div class="projectTitle column is-4">
<li> <h3>{{ project.Name }}</h3> </li>
</div>
<div class="projectSummary column is-7">
<li> <p>{{ project.Summary }}</p> </li>
</div>
</ul>
</div>
</template>
<script>
export default {
name: 'ProjectItem',
props: ['project'],
}
</script>
<style scoped>
.columns {
height: 100%;
padding: 0;
margin: 0;
}
.singleProjectContainer {
height: 72x;
margin: 0px;
}
.columns.projectPreview {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.projectIcon {
padding: 0 0 0 10px;
height: 100%;
}
.projectTitle {
height: 100%;
}
.projectIcon img {
height: 20px;
width: 20px;
}
.projectTitle h3 {
font-size: 1.2em;
font-family: 'Sporting Grotesque_Regular';
color: black;
}
</style>
【问题讨论】:
标签: html css vue.js flexbox bulma