유튜브 영상을 배경으로 쓰기 CSS

이런식으로 됩니다.
[code]<style>
* { box-sizing: border-box; }
.video-background {
background: #000;
position: fixed;
top: 0; right: 0; bottom: 0; left: 0;
z-index: -99;
}
.video-foreground,
.video-background iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
#vidtop-content {
top: 0;
color: #fff;
}
.vid-info { position: absolute; top: 0; right: 0; width: 33%; background: rgba(0,0,0,0.3); color: #fff; padding: 1rem; font-family: Avenir, Helvetica, sans-serif; }
.vid-info h1 { font-size: 2rem; font-weight: 700; margin-top: 0; line-height: 1.2; }
.vid-info a { display: block; color: #fff; text-decoration: none; background: rgba(0,0,0,0.5); transition: .6s background; border-bottom: none; margin: 1rem auto; text-align: center; }
@media (min-aspect-ratio: 16/9) {
.video-foreground { height: 300%; top: -100%; }
}
@media (max-aspect-ratio: 16/9) {
.video-foreground { width: 300%; left: -100%; }
}
@media all and (max-width: 600px) {
.vid-info { width: 50%; padding: .5rem; }
.vid-info h1 { margin-bottom: .2rem; }
}
@media all and (max-width: 500px) {
.vid-info .acronym { display: none; }
}
</style>[/code]
[code]
<div class="video-background">
<div class="video-foreground">
<iframe class="ww" src="https://www.youtube-nocookie.com/embed/n0AY4ebPy4w?autoplay=1&loop=1&controls=0&vq=hd720" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div id="vidtop-content">
<div class="vid-info">
<h1>YouTube</h1>
<p>Good!</p>
</div>
</div>
[/code]
댓글 17개
다만 한가지~
위 소스로는 loop=1 이 안먹길래 검색해보니 버전이 바뀌었네요
아래 소스 참고해주세요.
<iframe class="ww" src="https://www.youtube.com/embed/PBCGYqX-Njw?rel=0&autoplay=1&version=3
&loop=1&playlist=PBCGYqX-Njw&controls=1&vq=hd2160" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
version=3&loop=1
위 와같이 루프 앞에 버전이 표기되야 루프가 먹네요~
참고 : https://developers.google.com/youtube/player_parameters?hl=ko#loop
온갖 구글링에 하루종일 삽질하던게 다 해결 됐네요
배경 영상이 실행은 안되고 이미지만 배경으로 사용하는건가요 ...?
배경영상이 자동 실행이 되지 않네요 .....
지금 실행이 안되는데. 좀더 설명해주실수 잇는지요 ..!!
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4429 | ||
| 2574 | 10개월 전 | 561 | ||
| 2573 | 10개월 전 | 937 | ||
| 2572 |
두리삼촌v
|
10개월 전 | 609 | |
| 2571 | 10개월 전 | 556 | ||
| 2570 | 10개월 전 | 600 | ||
| 2569 |
두리삼촌v
|
10개월 전 | 638 | |
| 2568 |
두리삼촌v
|
10개월 전 | 667 | |
| 2567 |
두리삼촌v
|
10개월 전 | 463 | |
| 2566 |
두리삼촌v
|
10개월 전 | 443 | |
| 2565 | 10개월 전 | 740 | ||
| 2564 | 10개월 전 | 670 | ||
| 2563 | 10개월 전 | 474 | ||
| 2562 | 11개월 전 | 1030 | ||
| 2561 |
|
11개월 전 | 675 | |
| 2560 | 11개월 전 | 919 | ||
| 2559 | 11개월 전 | 657 | ||
| 2558 |
|
11개월 전 | 505 | |
| 2557 | 11개월 전 | 656 | ||
| 2556 | 11개월 전 | 957 | ||
| 2555 | 11개월 전 | 1338 | ||
| 2554 | 11개월 전 | 755 | ||
| 2553 |
|
11개월 전 | 748 | |
| 2552 | 11개월 전 | 676 | ||
| 2551 | 11개월 전 | 864 | ||
| 2550 | 11개월 전 | 767 | ||
| 2549 |
|
11개월 전 | 717 | |
| 2548 | 11개월 전 | 1031 | ||
| 2547 | 11개월 전 | 673 | ||
| 2546 | 11개월 전 | 1207 | ||
| 2545 | 11개월 전 | 663 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기