我需要在引導輪播中對齊左側的影像。
實際上每個影像都是中心位置。
<div id="testslider" class="carousel slide" data-ride="carousel" data-interval="false">
<div class="carousel-inner">
<?php if ( have_rows( 'galerie_de_photo' ) ) : ?>
<?php $count = 0; while ( have_rows('galerie_de_photo') ) : the_row(); ?>
<div class="carousel-item <?php if ($count == 0) { ?>active<?php } ?>">
<?php $visuel = get_sub_field( 'visuel' ); ?>
<?php if ( $visuel ) { ?>
<img src="<?php echo $visuel['url']; ?>" alt="<?php the_field( 'texte_alternatif' ); ?>" />
<?php } ?>
</div>
<?php
$count ;
endwhile; ?>
<?php endif; ?>
</div>
</div>
uj5u.com熱心網友回復:
您需要從.carousel-item元素中的影像中洗掉 100% 寬度。
像這樣的東西:
.carousel-item img {width: auto;}
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/338626.html
上一篇:如何加寬css中元素的側邊欄
