【发布时间】:2017-04-19 22:36:23
【问题描述】:
我在编写自己的 Wordpress 主题时遇到了问题。我在我的主页上展示了每篇博客文章的特色图片。我想让它看起来像一个画廊。所以我希望图像在彼此下方并彼此相邻显示,尽管它们的大小不同。看图看看我走了多远:
所以我想要完成的是,在 New York 的下方和 'c'est la vie' 的旁边显示花朵图像。有什么办法吗?
非常感谢您的帮助! 我的 HTML 代码:
<div class="post">
<div class="outer-wrapper">
<div class="imagefilter">
<a href='<?php the_permalink(); ?>'><?php
the_post_thumbnail('mythumbnail');?></a>
</div>
<div class="text-wrapper">
<span class="blogpost"><h2 class="post-title"><a href="<?php
the_permalink(); ?>"><?php the_title(); ?></a></h2></span>
</div>
</div>
</div>
我的 CSS 如下所示:
.outer-wrapper {
position: relative;
width: 470px;
height: 100%;
margin: 0px;
padding: 0px;
float: left;}
.text-wrapper {
position: absolute;
width: 470px;
text-align: center;
font-size: 12px;
display: table;
top: 50%;
height: 100%;
line-height: 0px;
opacity: 0;}
【问题讨论】:
-
你需要 Javascript。例如,您可以使用 masonry.desandro.com
标签: html css wordpress image thumbnails