【问题标题】:carousel slider showing images in new lines one after another not in a single line(sliding images)轮播滑块一个接一个地显示新行中的图像而不是一行(滑动图像)
【发布时间】:2021-03-15 06:41:49
【问题描述】:

我正在尝试在轮播滑块中显示图像,但问题是图像没有显示在一行中,并且滑动也无法正常工作,每个图像都显示在新行中,下一个和上一个按钮也没有显示。请检查下面的代码

            <div id="myCarousel" class="carousel slide">
                <!-- Indicators -->
                <ol class="carousel-indicators" id="indicators">
                <li data-target="#myCarousel" data-slide-to="0" class=""></li>
                <li data-target="#myCarousel" data-slide-to="1" class=""></li>
                <li data-target="#myCarousel" data-slide-to="2" class="active"></li>
                </ol>
                <div class="carousel-inner" id="homepageItems">
                    <div class="item">
                        <img src="/assets/Gallery/vd33qk3l.pj0.PNG"/>
                        
                    </div>
                    <div class="item">
                        <img src="/assets/Gallery/spzkmguq.duw.PNG"/>
                       
                    </div>
                    <div class="item active">
                        <img src="/assets/Gallery/bzmxjuy1.3ou.PNG"/>
                      
                    </div>
                </div>
              
                    <a class="carousel-control left" href="#myCarousel" data-slide="prev">
                        <span class="glyphicon glyphicon-chevron-left"></span>
                        <span class="sr-only">Previous</span>
                    </a>
                    <a class="carousel-control right" href="#myCarousel" data-slide="next">
                        <span class="glyphicon glyphicon-chevron-right"></span>
                        <span class="sr-only">Next</span>
                    </a>
                
            </div>
        </div>

【问题讨论】:

    标签: html asp.net asp.net-mvc carousel


    【解决方案1】:

    你试过“float:left”

    <style>
    .carousel-inner .item{
      float:left;
    }
    </style>
    

    https://jsfiddle.net/hfn07tkv/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-28
      • 2014-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多