Абсолютная позиция CSS не работает с некоторыми значками

#css #icons #position #absolute

#css #Значки #позиция #абсолютный

Вопрос:

У меня есть несколько правильно расположенных значков, однако расположение двух из них не работает.

Это мой первый подход:

[! [введите описание изображения здесь][1]] [1]

Все работает нормально, но я предпочитаю размещать значки, используя bottom вместо top position: absolute ), чтобы все значки были правильно размещены на других размерах экрана.

Однако использование bottom: 0 значка звезды вместе с его кругом находится в верхней части его контейнера:

[![введите описание изображения здесь][2]][2]

Код CSS:

 .film-player {
  display: flex;
  justify-content: center;
}

.film-player-border-outer {
  display: flex;
  justify-content: center;
  border-radius: 20px;
  height: 323px;
  width: var(--one-card-width);
  background-color: var(--color-space-shuttle);
  position: relative;
}

.film-player-border-inner {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  border-radius: 20px;
  height: 246px;
  width: calc(var(--one-card-width) - 20px);
  background-color: var(--color-black-magic);
}

.film-player-img {
  margin: 7px;
  border-radius: 15px;
  width: calc(var(--one-card-width) - 30px);
  overflow: hidden;
}

film-rate-circle-btn {
  position: absolute;
  bottom: 15px;
  left: 17px;
  height: 37px;
  width: 37px;
  border-radius: 50%;
  background: #fff;
}

.film-rate-number-btn {
  position: absolute;
  bottom: 23px;
  left: 21px;
}

/* star icon */
.star {
  position: absolute;
  bottom: 0px;
  left: 0px;
  /* top: 272px; */
  /* right: 210px; */
}

.star-circle {
  position: absolute;
  bottom: 0px;
  left: 0px;
  /* top: 267px; */
  /* right: 205px; */
}

/* play icon */
.film-play-btn {
  position: absolute;
  right: 16px;
  bottom: 7px;
  font-size: 35px;
  color: #fff;
}
 

HTML-код:

 <div class="film-player">
    <div class="film-player-border-outer">
        <div class="film-player-border-inner">
            <div class="film-player-img">
                <!-- <img src="../assets/img/resized/product-page/...jpg" alt=""> -->
            </div>
        </div>
        <div class="film-buttons">
          <div class="film-rating-btn">
              <div class="film-rate-circle-btn"></div>
              <span class="film-rate-number-btn">9.5</span>
          </div>
          <span class="material-icons star-circle">stars</span>
          <span class="material-icons star">grade</span>
          <div class="film-play-btn">
              <i class="fas fa-play-circle"></i>
          </div>
            
        </div>
    </div>
</div>
```


  [1]: https://i.stack.imgur.com/p9bG5.png
  [2]: https://i.stack.imgur.com/LsiP3.png
 

Комментарии:

1. Будет очень полезно, если вы включите соответствующий фрагмент html вместе с css, чтобы мы могли лучше определить проблему

2. Привет @RoboMop. Я добавил HTML-код. Заранее спасибо!

3. Мой код в порядке. Проблема заключалась в том, что у меня был неправильный css, связанный в моем HTML-файле 😅