gpt4 book ai didi

html - 如何将文字向上移动到图片旁边?

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

遇到了一个小问题,我尝试了 line-height 但是没有用。也许我想多了?

.blog-container ul{ 
list-style: none;
margin: 0;
padding: 0;
}

.blog-container .entry {
display: inline-block;
width: 170px;

padding: 0 0 0 0;

}

.posts li {
margin: 0;
padding: 0;
margin-bottom: 6px;
padding-bottom: 8px;
border-bottom: 2px solid rgba(0,0,0,0);
-webkit-border-image: url(http://uploadir.com/u/iee20dkw) 0 0 2 repeat;
-moz-border-image: url(http://uploadir.com/u/iee20dkw) 0 0 2 repeat;
-o-border-image: url(http://uploadir.com/u/iee20dkw) 0 0 2 repeat;
border-image: url(http://uploadir.com/u/iee20dkw) 0 0 2 repeat;
display:block;
line-height: 1.2em;
}

.blog-container img {
display: inline-block;
width: 40px;
height: 40px
}

.blog-container .entry .date {
display: block;
line-height: 0.7em;
}

HTML:

<ul class="posts">
<li>
<img src="https://cdn2.iconfinder.com/data/icons/interface-part-3/32/square-stack-small-48.png" alt="">
<div class="entry">
<a href="blog_post.html">This is a fucking test</a>
<span class="date">January 1st, 2013</span>
</div>
</li>
<li>
<img src="https://cdn2.iconfinder.com/data/icons/interface-part-3/32/square-stack-small-48.png" alt="">
<div class="entry">
<a href="blog_post.html">This is a fucking test</a>
<span class="date">January 1st, 2013</span>
</div>
</li>
</ul>

图片: enter image description here

和想法家伙?谢谢!

http://jsfiddle.net/3EKJR/ (它没有在 jsfiddle 中显示问题,但在上图中,这就是它所显示的。

最佳答案

好的,这似乎对我有用。我使用了 float:left

FIDDLE

.blog-container ul {
list-style: none;
margin: 0;
padding: 0;
}
.blog-container .entry {
display: block;
width: 170px;
padding: 0 0 0 0;
float:left;
}
.posts li {
height:35px;
margin: 0;
padding: 0;
margin-bottom: 6px;
padding-bottom: 8px;
border-bottom: 2px solid rgba(0, 0, 0, 0);
-webkit-border-image: url(http://uploadir.com/u/iee20dkw) 0 0 2 repeat;
-moz-border-image: url(http://uploadir.com/u/iee20dkw) 0 0 2 repeat;
-o-border-image: url(http://uploadir.com/u/iee20dkw) 0 0 2 repeat;
border-image: url(http://uploadir.com/u/iee20dkw) 0 0 2 repeat;
display:block;
line-height: 1.2em;
clear:both;
}
.blog-container img {
display: block;
float:left;
width: 40px;
height: 40px;
margin-right:10px;
}
.blog-container .entry .date {
display: block;
line-height: 0.7em;
}

关于html - 如何将文字向上移动到图片旁边?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22028720/

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