Tumblr:如何让div围绕照片? [英] Tumblr: how to make div wrap around photo?
问题描述
以下是网页: http://dimashishkov.tumblr.com/ 。我如何使div围绕图像紧紧包裹?现在它粘贴在图像的底部4px(参见红线,我给出了红色背景)。这真的让我很难过。我无法理解这些4 px来自哪里以及如何摆脱它们。 给图像 vertical-align:bottom
或者给出包含div line-height:0
。
这是由于图像设置为 inline-block
以及 inline
元素的方式是渲染。你也可以使图像成为块级元素。
您的选择。
Here's the web-page: http://dimashishkov.tumblr.com/ . How do I make div wrap around image tightly? Now it sticks at the bottom of the image for 4px (see red line, I gave a div red background). It is really killing me. I can't understand where those 4 px come from and how to get rid of them.
Give the image vertical-align: bottom
or give the containing div line-height: 0
.
This is due to the fact the image is set to inline-block
and the way inline
elements are rendered. You could also make the image a block level element.
Your choice.
这篇关于Tumblr:如何让div围绕照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!