Как сделать загрузочную карусель с надписью с правой стороны? - PullRequest
0 голосов
/ 04 июня 2018


Я пытаюсь сделать подпись справа.Тем не менее, он просто выравнивается по левой стороне.

CSS:

#jumboCarousel {
    margin-top: 70px;
    min-height: 300px;
    max-height: 600px;
    min-width: 100%;
}
#jumboCarousel img {
    min-height: 300px;
  max-height: 600px;
    min-width: 100%;
}
#jumboCarousel > .carousel-indicators > li {
    border-radius: 0px;
    min-width: 25px;
    background-color: #9d9d9d;
    border: 1px solid black;
    margin-right: 10px;;
    margin-left: 10px;;
}
#jumboCarousel > .carousel-indicators > .active {
    background-color: orange;
}
#jumboCarousel .carousel-caption {
    color: white;
    xright: 58%;
    text-align: center;
    max-width: 300px;
    right: 0;
    top: 1px;
  /*top: 50%; */
  xtransform: translateY(-50%);
  xbottom: initial;
  background: rgba(0,0,0,0.5);
  padding:10px;
  height:100%;

}

.item {
    -webkit-transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  transform-style: preserve-3d;
  }

Код для моей проблемы: https://codepen.io/mrsalami/pen/VdeGYK?editors=1100

Ответы [ 2 ]

0 голосов
/ 04 июня 2018

Проблема, похоже, в том, что осталось: 20%;значение в классе .carousel-caption.

Решение состоит в том, чтобы добавить left: initial;

    #jumboCarousel .carousel-caption {left:initial;}
0 голосов
/ 04 июня 2018

Просто добавьте left: auto; к #jumboCarousel .carousel-caption

#jumboCarousel .carousel-caption {
    color: white;
    text-align: center;
    max-width: 300px;
    right: 0;
    top: 1px;
    xtransform: translateY(-50%);
    xbottom: initial;
    background: rgba(0,0,0,0.5);
    padding: 10px;
    height: 100%;
    left: auto; /*Added*/
}
...