gpt4 book ai didi

html - img 和文本垂直对齐

转载 作者:太空宇宙 更新时间:2023-11-03 23:55:08 25 4
gpt4 key购买 nike

<div class="card">
<img class='sound' src='https://www.google.com/images/srpr/logo4w.png'>
<div class='txt'>
this is a sentence.this is a sentencethis is a sentence.
</div></div>

.card{
margin:5px 14px;
border:thin solid blue;
}
.sound{
width:32px;
height:32px;
cursor:pointer;
}
.txt{
display:inline-block;
margin-left:25px;
vertical-align:middle; //doesn't work
border:thin solid red;
}

如何将 .txt div 对齐到 .sound 图像的中间? fiddle 是 here

最佳答案

.sound 上放置垂直对齐?

.card{
margin:5px 14px;
border:thin solid blue;
}
.sound{
width:32px;
height:32px;
cursor:pointer;
vertical-align:middle;
}
.txt{
display:inline-block;
margin-left:25px;
border:thin solid red;
}

http://jsfiddle.net/hWejY/1/

关于html - img 和文本垂直对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18946543/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com