문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 다음 판 | 이전 판 | ||
|
wiki:css:css_note:css_image_gallery [2021/03/31 11:36] emblim98 만듦 |
wiki:css:css_note:css_image_gallery [2023/01/13 18:44] (현재) |
||
|---|---|---|---|
| 줄 13: | 줄 13: | ||
| ====예제==== | ====예제==== | ||
| < | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | div.gallery { | ||
| + | margin: 5px; | ||
| + | border: 1px solid #ccc; | ||
| + | float: left; | ||
| + | width: 180px; | ||
| + | } | ||
| + | div.gallery: | ||
| + | border: 1px solid #777; | ||
| + | } | ||
| + | div.gallery img { | ||
| + | width: 100%; | ||
| + | height: auto; | ||
| + | } | ||
| + | div.desc { | ||
| + | padding: 15px; | ||
| + | text-align: center; | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | < | ||
| + | <div class=" | ||
| + | <a target=" | ||
| + | <img src=" | ||
| + | </a> | ||
| + | <div class=" | ||
| + | </ | ||
| + | <div class=" | ||
| + | <a target=" | ||
| + | <img src=" | ||
| + | </a> | ||
| + | <div class=" | ||
| + | </ | ||
| + | <div class=" | ||
| + | <a target=" | ||
| + | <img src=" | ||
| + | </a> | ||
| + | <div class=" | ||
| + | </ | ||
| + | <div class=" | ||
| + | <a target=" | ||
| + | <img src=" | ||
| + | </a> | ||
| + | <div class=" | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | \\ | ||
| + | ===Result=== | ||
| + | {{: | ||
| + | \\ | ||
| + | =====More Examples====== | ||
| + | =====Responsive Image Gallery===== | ||
| + | 데스크탑, | ||
| + | ====예제==== | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | |||
| + | < | ||
| + | < | ||
| + | div.gallery { | ||
| + | border: 1px solid #ccc; | ||
| + | } | ||
| + | |||
| + | div.gallery: | ||
| + | border: 1px solid #777; | ||
| + | } | ||
| + | |||
| + | div.gallery img { | ||
| + | width: 100%; | ||
| + | height: auto; | ||
| + | } | ||
| + | |||
| + | div.desc { | ||
| + | padding: 15px; | ||
| + | text-align: center; | ||
| + | } | ||
| + | |||
| + | * { | ||
| + | box-sizing: border-box; | ||
| + | } | ||
| + | |||
| + | .responsive { | ||
| + | padding: 0 6px; | ||
| + | float: left; | ||
| + | width: 24.99999%; | ||
| + | } | ||
| + | |||
| + | @media only screen and (max-width: 700px) { | ||
| + | .responsive { | ||
| + | width: 49.99999%; | ||
| + | margin: 6px 0; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | @media only screen and (max-width: 500px) { | ||
| + | .responsive { | ||
| + | width: 100%; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | .clearfix: | ||
| + | content: ""; | ||
| + | display: table; | ||
| + | clear: both; | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | |||
| + | <div class=" | ||
| + | <div class=" | ||
| + | <a target=" | ||
| + | <img src=" | ||
| + | </a> | ||
| + | <div class=" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <div class=" | ||
| + | <div class=" | ||
| + | <a target=" | ||
| + | <img src=" | ||
| + | </a> | ||
| + | <div class=" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <div class=" | ||
| + | <div class=" | ||
| + | <a target=" | ||
| + | <img src=" | ||
| + | </a> | ||
| + | <div class=" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <div class=" | ||
| + | <div class=" | ||
| + | <a target=" | ||
| + | <img src=" | ||
| + | </a> | ||
| + | <div class=" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <div class=" | ||
| + | |||
| + | <div style=" | ||
| + | <p> | ||
| + | This example use media queries to re-arrange the images on different screen sizes: for screens largers than 700px wide, it will show four images side by side, for screens smaller than | ||
| + | 700px, it will show two images side by side. For screens smaller than 500px, the images will stack vertically (100%). | ||
| + | </p> | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| </ | </ | ||
| + | \\ | ||
| + | ===Result==== | ||
| + | {{: | ||
| {{tag> | {{tag> | ||