admin管理员组文章数量:1335411
The items are not listed in order there is a gap between item listed how to fix this.
Screenshot:
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<div class="tg-topcity">
<figure class="tg-cityimg">
<img src="<?php echo esc_url( $cat_image ); ?>" alt="<?php esc_html_e('City Image', 'listingo'); ?>">
<figcaption>
<h3><a href="<?php echo esc_url( get_term_link( $value->term_id, 'cities' ) ); echo esc_attr( $custom_url ); ?>"><?php echo esc_attr( $value->name ); ?></a></h3>
<span><?php echo esc_attr( $total_users ); ?> <?php esc_html_e('Listings', 'listingo'); ?></span>
</figcaption>
</figure>
</div>
</div>
<?php } } ?>
</div>
CSS
.tg-topcity, .tg-popularcities {
width: 100%;
float: left;
}
The items are not listed in order there is a gap between item listed how to fix this.
Screenshot: https://prnt.sc/sphfig
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<div class="tg-topcity">
<figure class="tg-cityimg">
<img src="<?php echo esc_url( $cat_image ); ?>" alt="<?php esc_html_e('City Image', 'listingo'); ?>">
<figcaption>
<h3><a href="<?php echo esc_url( get_term_link( $value->term_id, 'cities' ) ); echo esc_attr( $custom_url ); ?>"><?php echo esc_attr( $value->name ); ?></a></h3>
<span><?php echo esc_attr( $total_users ); ?> <?php esc_html_e('Listings', 'listingo'); ?></span>
</figcaption>
</figure>
</div>
</div>
<?php } } ?>
</div>
CSS
.tg-topcity, .tg-popularcities {
width: 100%;
float: left;
}
Share
Improve this question
asked May 28, 2020 at 14:37
Emma ExpatEmma Expat
256 bronze badges
2
- Welcome to WPSE, Emma! This sounds like a CSS-specific question. You might try asking on StackOverflow or inspect the elements to toggle styles on and off to find out what is causing the gap and how to fix it, but I would suspect it may have to do with Bootstrap's styles, since their column styles are used on the outer wrapper. – WebElaine Commented May 28, 2020 at 14:45
- Hi @WebElaine I have posted question on StackOverflow stackoverflow/questions/62069439/… if you know the solution please suggest. – Emma Expat Commented May 29, 2020 at 8:07
1 Answer
Reset to default 1The problem sounds to be related to CSS, try using the following solution:
.tg-topcity, .tg-popularcities { width: 100%; display :inline-block; float: left; }
or you may also try this instead:
.tg-topcity, .tg-popularcities{ display: flex; flex-direction: row; flex-wrap: wrap; }
本文标签: CSS gap issue in div element
版权声明:本文标题:CSS gap issue in div element 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742386345a2465111.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论