似乎可以移动图像,我需要并排显示图像和文本,但是我希望能够将图像移动一点点以便中间部分或图像与文本排列在一起。现在它是底部,无论我做什么,或不会上下移动,这里是div中的HTML,然后CSS遇到我的css问题
<div class="img">
<img src="/image/file/location">
<div class="imgwording">
<img src="/image/file/location" class="logoimage">
Test Text
</div>
<div class="sub">
<img src="/image/file/location" class="mail">
Test Text
</div>
<div class="imagelinks1">
Training &</br>Events
</div>
<div class="imagelinks2">
Trauma & Gender</br>Projects
</div>
<div class="imagelinks3">
Behavioral Health</br>Resources
</div>
</div>
CSS:
.imgwording {
text-decoration: none !important;
line-height: 1.28;
letter-spacing: 1.5px;
text-align: center;
font-size: 48px;
padding: 0px 60px !important;
position: absolute;
top: 65px;
width: 100%;
font-family: eb garamond,serif;
color: #fff;
display:flex;
justify-content:center;
align-items:center;
flex-direction:column;
left: -110px;
display: inline-block;
}
.logoimage {
width: 50px;
height: 100px;
}
可能重复http://stackoverflow.com/questions/9201756/how-to-put-img-inline-with-text – chazsolo
你可以尝试把图像作为背景,或者如果失败,你可以使其绝对位置,并添加填充 - 左div – pol
图像和文本已经内联,但图片的底部与文本的底部内联,我想知道如何只向上移动图像或以便图像与文本仍然内嵌,但看起来像在中间,如果有意义 – TheHiddenPerson