简体   繁体   English

内联显示留白空间

[英]Inline display leaves white space

At the bottom of this page I have a media gallery. 此页面的底部,我有一个媒体库。 The first three photos are the photo gallery, Inlined after it I placed some video thumbnails. 前三张照片是照片库,在其中放置了一些视频缩略图后,会内联。 For some reason the alignment of each element of the video gallery is messed up. 由于某种原因,视频库的每个元素的对齐方式都混乱了。 Can you help me? 你能帮助我吗?

This is the HTML of each video thumbnail: 这是每个视频缩略图的HTML:

<?php  if((get_post_meta($post->ID, 'url_video3', true))) { ?>
<div class="video_container">
<a href="#TB_inline?inlineId=url_video3&width=600&height=400" class="thickbox video">
<?php $attachment_id = get_field('icona_video3'); echo wp_get_attachment_image( $attachment_id, icona); ?>
<div class="play-icona"><img src="<?php bloginfo('template_url'); ?>/images/video_link.png" /></div>
</a>
</div>
<?php } ?>

And this is the CSS: 这是CSS:

.thickbox.video {
text-decoration: none !important;
width: 96px !important;
height: 96px !important;
}
.video_container {
position: relative;
display: inline-block;
height: 96px !important;
width: 96px !important;
margin: 0 !important;
padding: 0 !important;
}
.play-icona {
position:absolute;
left:35%;
top:35%;
}

Generally speaking, inline-block elements respect surrounding whitespace (following the standard whitespace collapsing rules). 一般而言, inline-block元素尊重周围的空白(遵循标准的空白折叠规则)。 If rendering an element with inline-block causes noticeable gaps around the element, make sure the two elements in HTML are right up against one another — if there are any newlines or spaces, they'll get translated into a gap by the web browser. 如果使用inline-block渲染一个元素会导致该元素周围出现明显的间隙,请确保HTML中的两个元素相互对立-如果有任何换行符或空格,它们将被网络浏览器转换为间隙。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM