Manage bootstrap carousel with media queries -


i have unique carousel used in different pages different height. when try manage carousel control , icons used in different screen sizes use media queries following css instructions:

@media screen , (min-width : 1224px)  {  #carouseli .carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right {   font-size: 24px;   line-height: 24px;   margin-top: -35px;  }  #carouselr .carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right {   font-size: 24px;   line-height: 24px;   margin-top: -35px;  } } 

but when modify settings of carouselr, affects both carousels. don't know why if select object # symbol.

anybody can me issue?

thank in advanced

post updated html code:

<div class="col-xs-6 col-xs-offset-3 col-md-4 col-md-offset-0">     <div class="container-fluid">         <div class="row">             <section class="block">                 <div id="carouseli" class="carousel slide" data-ride="carousel">                     <!-- indicators -->                     <ol class="carousel-indicators">                         @{                             int c = 0;                             foreach (var imagen in model.imagenesanuncio)                             {                                 var itemclass = c++ == 0 ? "active" : "";                                 <li data-target="#carouseli" data-slide-to="@c" @itemclass></li>                             }                         }                     </ol>                      <!-- wrapper slides -->                     <div class="carousel-inner">                         @{                             int = 0;                             foreach (var imagen in model.imagenesanuncio)                             {                                 var itemclass = i++ == 0 ? "item active" : "item";                                 <div class="@itemclass">                                     <a href="@url.content(viewbag.path + imagen.nombrefichero)" data-lightbox="image-1">                                         <div style="background:url(@url.action("thumbnail", "anuncio", new { width = 420, height = 420, filename = @imagen.nombrefichero })) center center; background-size:cover;" class="slider-size">                                            </div>                                     </a>                                 </div>                             }                         }                     </div>                 </div>                    <!-- controls -->                 <a class="left carousel-control" href="#carouseli" role="button" data-slide="prev">                     <span class="glyphicon glyphicon-chevron-left"></span>                 </a>                 <a class="right carousel-control" href="#carouseli" role="button" data-slide="next">                     <span class="glyphicon glyphicon-chevron-right"></span>                 </a>             </section>         </div>     </div> </div> 

you have use #carouseli , #carouselr before each css selector.

@media screen , (min-width: 1224px) {   #carouseli .carousel-control .icon-prev,   #carouseli .carousel-control .icon-next,   #carouseli .carousel-control .glyphicon-chevron-left,   #carouseli .carousel-control .glyphicon-chevron-right {     font-size: 24px;     line-height: 24px;     margin-top: -35px;   }   #carouselr .carousel-control .icon-prev,   #carouselr .carousel-control .icon-next,   #carouselr .carousel-control .glyphicon-chevron-left,   #carouselr .carousel-control .glyphicon-chevron-right {     font-size: 24px;     line-height: 24px;     margin-top: -35px;   } } 

codepen


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -