728x90
๋ฐ์ํ
CSS
์ด๋ฏธ์ง ์๋ ์ฌ๋ผ์ด๋ ๋ง๋ค๊ธฐ
: ํ๋ฌ๊ฐ๋ ์ด๋ฏธ์ง
โ ์ํฉ
→ HTML๊ณผ CSS๋ง์ผ๋ก ์ด๋ฏธ์ง ์๋ ์ฌ๋ผ์ด๋ ๋ง๋ค๊ณ ์ถ์ ๋
๐ข HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Slide Image</title>
</head>
<body>
<div id="slider">
<div class="image-box">
<div><img class="" src="../images/ch_tiktok.png" alt=""></div>
<div><img class="" src="../images/ch_facebook.png" alt=""></div>
<div><img class="" src="../images/ch_insta.png" alt=""></div>
<div><img class="" src="../images/ch_kakao.png" alt=""></div>
<div><img class="" src="../images/ch_notion.png" alt=""></div>
<div><img class="" src="../images/ch_github.png" alt=""></div>
<div><img class="" src="../images/ch_line.png" alt=""></div>
<div><img class="" src="../images/ch_youtube.png" alt=""></div>
<!-- clone -->
<div><img class="" src="../images/ch_tiktok.png" alt=""></div>
<div><img class="" src="../images/ch_facebook.png" alt=""></div>
<div><img class="" src="../images/ch_insta.png" alt=""></div>
<div><img class="" src="../images/ch_kakao.png" alt=""></div>
<div><img class="" src="../images/ch_notion.png" alt=""></div>
<div><img class="" src="../images/ch_github.png" alt=""></div>
<div><img class="" src="../images/ch_line.png" alt=""></div>
<div><img class="" src="../images/ch_youtube.png" alt=""></div>
</div>
</div>
</body>
</html>
๐ข CSS
@charset "UTF-8";
#slider {
overflow: hidden;
position: relative;
/* border: 20px solid red; */
/* // ์ด๋ฏธ์ง ๋ณด์ฌ์ง๋ ๋ทฐ ๋ถ๋ถ๋งํผ px์กฐ์ */
width: 1440px;
height: 140px;
box-sizing: border-box;
}
.image-box {
/* ์๋ณธ+ํด๋ก ์ ์ด ํฉ */
width:5478px;
height:100%;
display:flex;
flex-wrap:nowrap;
animation: bannermove 20s linear infinite;
}
.image-box > div {
margin: 0px -1px 0px 0px;
}
@keyframes bannermove {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(-50%, 0);
}
}
๐ข ๊ตฌํ ํ์ด์ง
๐ข ์ ์ฒด ์ฝ๋
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Slide</title>
<style>
#slider {
overflow: hidden;
position: relative;
/* border: 20px solid red; */
/* // ์ด๋ฏธ์ง ๋ณด์ฌ์ง๋ ๋ทฐ ๋ถ๋ถ๋งํผ px์กฐ์ */
width: 1440px;
height: 140px;
box-sizing: border-box;
}
.image-box {
/* ์๋ณธ+ํด๋ก ์ ์ด ํฉ */
width:5478px;
height:100%;
display:flex;
flex-wrap:nowrap;
animation: bannermove 20s linear infinite;
}
.image-box > div {
margin: 0px -1px 0px 0px;
}
@keyframes bannermove {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(-50%, 0);
}
}
</style>
</head>
<body>
<div id="slider">
<div class="image-box">
<div><img class="" src="../images/ch_tiktok.png" alt=""></div>
<div><img class="" src="../images/ch_facebook.png" alt=""></div>
<div><img class="" src="../images/ch_insta.png" alt=""></div>
<div><img class="" src="../images/ch_kakao.png" alt=""></div>
<div><img class="" src="../images/ch_notion.png" alt=""></div>
<div><img class="" src="../images/ch_github.png" alt=""></div>
<div><img class="" src="../images/ch_line.png" alt=""></div>
<div><img class="" src="../images/ch_youtube.png" alt=""></div>
<!-- clone -->
<div><img class="" src="../images/ch_tiktok.png" alt=""></div>
<div><img class="" src="../images/ch_facebook.png" alt=""></div>
<div><img class="" src="../images/ch_insta.png" alt=""></div>
<div><img class="" src="../images/ch_kakao.png" alt=""></div>
<div><img class="" src="../images/ch_notion.png" alt=""></div>
<div><img class="" src="../images/ch_github.png" alt=""></div>
<div><img class="" src="../images/ch_line.png" alt=""></div>
<div><img class="" src="../images/ch_youtube.png" alt=""></div>
</div>
</div>
</body>
</html>
728x90
๋ฐ์ํ
'๐ปCoding > ๐ CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[CSS] width height 100% ์ 100vh์ ์ฐจ์ด์ (0) | 2022.09.04 |
---|---|
[css] css background : transparent ๋? | background : none ์ด๋ ์ฐจ์ด์ (0) | 2022.09.02 |
[css] CSS ์คํ์ผ ์ ๊ฑฐ : reset CSS (๊ธฐ๋ณธ ์คํ์ผ ์ง์ฐ๊ธฐ) (0) | 2022.08.28 |
[CSS] html aํ๊ทธ ์คํ์ผ ์์ ๊ธฐ : css ์คํ์ผ ์ง์ฐ๊ธฐ (0) | 2022.08.21 |
CSS _์ปฌ๋ฌ_color (0) | 2021.11.23 |