Parallax(시차를 이용한 효과) - 겁나 빠른 웹 레시피
수업소개 parallax는 시차라는 뜻으로 천문학에서 사용하는 용어입니다. 즉 멀리 있는 물체는 천천히 움직이고, 가까이 있는 물체는 빨리 움직이는 현상을 의미하죠. 이 현상을 이용하면 입체감,
opentutorials.org
HTML
<section class="scene one">
<header>
<h1>Lorem ipsum dolor sit amet. </h1>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti adipisci fugiat deserunt
</header>
</section>
<section class="scene two">
<header>
<h1>Lorem ipsum dolor sit amet. </h1>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti adipisci fugiat deserunt
</header>
</section>
<section class="scene three">
<header>
<h1>Lorem ipsum dolor sit amet. </h1>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti adipisci fugiat deserunt
</header>
</section>
CSS
.scene {
height: 100vh;
overflow: hidden;
background-size: cover;
background-attachment: fixed;
font-family: 'Source Sans Pro', sans-serif;
}
.scene.one {
background-image: url(img/heic0910e.jpg);
}
.scene.two {
background-image: url(img/heic1501a.jpg);
}
.scene.three {
background-image: url(img/heic1608a.jpg);
}
.scene header {
color: white;
max-width: 50%;
position: relative;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
font-size: 1.5rem;
text-align: center;
}
.scene header h1 {
font-size: 2rem;
margin-bottom: 1rem;
font-weight: 600;
}
.scene header h1:after{
content: '';
border-bottom: 1px solid white;
display: block;
width: 8rem;
margin: 0 auto;
margin-top: 1rem;
}
이 영상이 찍힐 당시인 2016년엔 신기술이었다. 학교에서 이 기술로 웹 페이지를 만들고 간지난다고 좋아했던 기억이 난다.
반응형
'WEB > HTML&CSS' 카테고리의 다른 글
flexbox LandingPage (0) | 2022.08.31 |
---|---|
float 레이아웃 예시1 (0) | 2022.08.25 |
간단한 CardBox (0) | 2022.08.24 |