I want to disable border-bottom of the last elemnt inside a while loop, but it doesn’t work…
This is the code:
<div class="col-sm-4">
<?php if ( $the_query->have_posts() ): ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<h2 class="special-project-title"><?php the_title()?></h2> <br/>
<div class="post-meta special-project-meta"><?php mida_post_meta()?></div><br/>
<a class="more-link spaciel-project-more" href="<?php echo the_permalink() ?>"><?php echo __('Read More', 'mida')?></a><br/>
<?php endwhile; endif;?>
<?php wp_reset_query(); ?>
</div>
“spaciel-project-more” has a border bottom, but I want the last one to not have a border bottom.. can’t figure this out..
CSS:
.spaciel-project-more{
border-bottom: 1px solid black;
margin-top: -15px;
margin-bottom: -15px;
padding-bottom: 15px;
}
.spaciel-project-more:last-child{
border-bottom:none;
}
Thanks in advance!
It is not the
:last-child
because there is some other content after that. You can use:last-of-type
:Demo: JSFiddle
use this in your style in css may help you