【发布时间】:2017-12-29 11:02:25
【问题描述】:
每个 div 都在获取我上传到 WordPress 的背景图片。我希望能够上传任何分辨率的图像以用作背景图像,同时保持每个 div 的高度相同。
HTML:
<?php get_header(); ?>
<div class="row portfolio-content">
<?php if( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="col-xs-12 col-sm-6 col-md-4 portfolio-item">
<a href="#">
<img src="<?php echo
wp_get_attachment_url(get_post_thumbnail_id()); ?>" alt="">
</a>
</div>
<?php endwhile; endif; ?>
</div>
<?php get_footer(); ?>
Sass/CSS:
.portfolio-content{
.portfolio-item{
@include global-box-shadow;
@include global-div-spacing;
background: $white;
text-align: center;
padding: 2rem;
a{
position: relative;
text-decoration: none;
img{
width: 100%;
}
}
}
}
【问题讨论】:
标签: html css wordpress twitter-bootstrap