• 회원가입
  • 로그인
  • 구글아이디로 로그인

[css] CSS - 반응형 마름모 갤러리 (Responsible Rhomb gallery on grids + clip-path)

 

 

<style>

HTML, BODY {

  height: 100%;

  font-size: 16px;

  line-height: 1.5;

  font-family: Trebuchet MS, Helvetica, Arial, sans-serif;

}


BODY {

  overflow: hidden;

  background: #222;

  background: linear-gradient(to right, rgba(255, 255, 255, 0.025) 10%, transparent 0), linear-gradient(#222, #000);

  background-size: .75em 100%, 100% 100%;

  display: flex;

  align-items: center;

}


.wrapper {

  position: relative;

  flex-grow: 1;

  margin: auto;

  max-width:750px ;

  max-height: 1200px;

  display: grid;

  grid-template-columns: repeat(8, 1fr);

  grid-template-rows: repeat(4, 1fr);

  grid-gap: 2vmin;

  justify-items: center;

  align-items: center;

}


IMG {

  z-index: 1;

  grid-column: span 2;

  max-width: 100%;

  margin-bottom: -52%;

  -webkit-clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);

          clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);

  -webkit-transform: scale(1);

          transform: scale(1);

  transition: all .25s;

}

IMG:nth-child(7n + 1) {

  grid-column: 2 / span 2;

}

IMG:hover {

  z-index: 2;

  -webkit-transform: scale(2);

          transform: scale(2);

}

</style>

 

<div class="wrapper">

  <img src="https://source.unsplash.com/random/600x600?water" alt="">

  <img src="https://source.unsplash.com/random/600x600?summer" alt="">

  <img src="https://source.unsplash.com/random/600x600?plants" alt="">

  <img src="https://source.unsplash.com/random/600x600?snow" alt="">

  <img src="https://source.unsplash.com/random/600x600?roses" alt="">

  <img src="https://source.unsplash.com/random/600x600?sky" alt="">

  <img src="https://source.unsplash.com/random/600x600?nature" alt="">

  <img src="https://source.unsplash.com/random/600x600?blossom" alt="">

  <img src="https://source.unsplash.com/random/600x600?ice" alt="">

  <img src="https://source.unsplash.com/random/600x600?spring" alt="">

</div>

 

결과보기

yoksel 님 https://codepen.io/yoksel/pen/PooVvwZ

 

방문 감사합니다. (즐겨찾기 등록: Ctrl + D)

분류 제목
border CSS - border-inline-style 속성 -
border CSS - border-inline-width 속성 -
border CSS - border-start-end-radius 속성 -
border CSS - border-start-start-radius 속성 -
box CSS - box-decoration-break 속성 - 요소 상자 깨지는 방식 지정 (= box-decor…
css CSS - box-reflect 속성 (비표준) - 요소의 반사체 생성 (= box-reflect속성 = 박…
css CSS - break-after 속성 - 지정요소 뒤에서 (페이지분할/컬럼분할/영역분할) 발생 여부 지정 (…
css CSS - break-before 속성 - 지정요소 앞에서 (페이지중단/컬럼중단/영역중단) 발생 여부 지정 …
css CSS - break-inside 속성 - 지정요소 내 (페이지중단/컬럼중단/영역중단) 발생 여부 지정 (=…
css CSS - caret-color 속성 - '입력/편집' 가능 요소의 커서 색상 변경 (= caret-colo…
css CSS - clip-path 속성 - 보일 범위 지정해 자르기 (= clip-path속성 = 클립패스속성)
counter CSS - counter-set 속성 - 카운터 초기값(=시작값)을 부모요소에 설정 (= counter-se…
table CSS - empty-cells 속성 - 테이블 빈 셀 테두리 표시 여부 (= empty-cells속성 = …
font CSS - font-feature-settings 속성 - OpenType 글꼴의 고급 인쇄 기능 제어 (=…
font CSS - font-kerning 속성 - 문자 모양 고려해, 문자 사이 간격 지정 (= font-kerni…
font CSS - font-size-adjust 속성 - 소문자 x 높이 기준으로, 대체 글꼴 크기 재조정 (= f…
font CSS - font-stretch 속성 - 폰트 너비 조정 (= font-stretch속성 = 폰트스트레치속…
font CSS - font-variant-caps 속성 -
css CSS - hyphens 속성 - 긴 텍스트 단어에서 하이픈 표시 방법 지정 (= hyphens속성 = 하이…
css CSS - hyphenate-character 속성 - 하이픈 줄바꿈 시, 라인 끝 하이픈 모양 지정 (= …
20/25
목록
찾아주셔서 감사합니다. Since 2012