Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On the mobile phone, how to fill the height of the square? #250

Closed
Jairwin-L opened this issue Jul 18, 2023 · 0 comments
Closed

On the mobile phone, how to fill the height of the square? #250

Jairwin-L opened this issue Jul 18, 2023 · 0 comments

Comments

@Jairwin-L
Copy link

html

<div
    className={css.playerWrapper}
  >
    <Vimeo
      video={item.cover_video_url}
      className={css.videoPlayer}
      muted
      loop
      background
      controls={false}
    />
  </div>

css

.playerWrapper {
    overflow: hidden;
    width: 100%;
    padding-bottom: 100%;
    position: relative;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
   @media only screen and (min-width: 768px) {
      padding-bottom: 56.25%;
    }
    .videoPlayer {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      iframe {
        width: 100%;
        height: 100%;
      }
    }
  }

Hope it can fill the whole height
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant