html 훈련 - (14) Video Player

frenchkebab·2021년 10월 25일
0

Video Player



😀 html


html 코드

<video>
  <source src="./assets/염따(YUMDDA) - 9ucci REMIX (feat. Paloalto, Jessi, UNEDUCATED KID, The Quiett).mp4" />
  <source src="./assets/염따(YUMDDA) - 9ucci REMIX (feat. Paloalto, Jessi, UNEDUCATED KID, The Quiett).mp4" />
</video>
<h1>염따 - 9ucci REMIX</h1>
<p> flex 해버렸지 모얌~ </p>

결과 화면


😀 css 입히기


css 코드

index.html

<!DOCTYPE html>
<html lang="ko">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Video Player</title>
    <link rel="stylesheet" href="./styles.css" />
  </head>
  <body>
    <div class="video-player">
      <div class="video-container">
        <video controls>
          <source src="./assets/염따(YUMDDA) - 9ucci REMIX (feat. Paloalto, Jessi, UNEDUCATED KID, The Quiett).mp4" />
          <source src="./assets/염따(YUMDDA) - 9ucci REMIX (feat. Paloalto, Jessi, UNEDUCATED KID, The Quiett).mp4" />
        </video>
      </div>
      <div video-player-info>
        <h1>염따 - 9ucci REMIX</h1>
        <p> flex 해버렸지 모얌~ </p>
      </div>
    </div>
  </body>
</html>

styles.css

@import url(https://spoqa.github.io/spoqa-han-sans/css/SpoqaHanSans-kr.css);

* {
  margin: 0;
  box-sizing: border-box;
}

html {
  font-family: 'SpoqaHanSans';
  font-size: 16px;
  line-height: 1.5;
  color: #1f2d3d;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100vh;
  margin: 0 auto;
  background-color: #f8f9fa;
}

body::after {
  content: 'frenchkebab©';
  display: block;
  margin-top: 50px;
  color: #1f2d3d;
  font-size: 12px;
  font-weight: 600;
}

.video-player {
  width: 100%;
  max-width: 400px;
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 200ms;
}

.video-player:hover {
  box-shadow: 0 3px 20px 0 rgba(0, 0, 0, 0.05);
}

.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.24%;
  overflow: hidden;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-player-info {
  background-color: #fff;
  padding: 8px 10px 10px;
}

.video-player-info h1 {
  margin-bottom: 2px;
  font-size: 16px;
  letter-spacing: -0.03em;
  color: #383838;
}

.video-player-info p {
  font-size: 13px;
  letter-spacing: -0.03em;
  color: #8e8e93;
}

결과 화면


😀 알아갈 점들


😎 여러 종류의 확장자를 넣으려고 하는 경우

video 태그 안에 src 속성으로 넣지 않고, 따로 source 태그를 사용한다!


profile
Blockchain Dev Journey

0개의 댓글