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

[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

 


분류 제목
text CSS - direction 속성 - 텍스트방향 (= 텍스트진행방향 = direction속성 = 디렉션속성)…
box CSS - padding-top 속성 - 안쪽여백상단 (= padding-top속성 = 패딩탑속성 = 패딩톱…
box CSS - margin-bottom 속성 - 하단바깥여백 (= 하단마진, 아래쪽마진 = margin-bott…
gradient CSS - Gradient (그레이디언트 = 그라디언트) 종류 - (색번짐변화=색변화) : IE 10
selector CSS - [attribute] 속성선택자 - 특정 속성 보유 요소 (IE7) ※ 여러 속성 보유 선택자
box CSS - padding-left 속성 - 안쪽여백좌측 (= padding-left속성 = 패딩레프트속성)
background CSS - background-repeat 속성 ★ - 배경이미지 반복 (= 배경반복 = background…
selector CSS - [attribute=value] 속성선택자 - 지정속성값보유요소 선택 (IE7) ※ 특정 (속성/…
text CSS - word-break 속성 ★ - 한중일 외의 언어 (단어기준/글자기준) 줄바꿈규칙 지정 (= 줄…
box CSS - margin-right 속성 - 바깥여백우측 (= margin-right속성 = 마진라이트속성)
func CSS - var() 함수 ★★ - 사용자정의 속성/속성값 변수 호출 (= var함수 = 바함수) ※ :r…
selector CSS - element element 자손선택자 ★ - 자손요소 (요소선택자)
animation CSS - @keyframes 구문 - 애니메이션 코드 사용 선언 (= 애니사용 = @keyframes속성 …
table CSS - caption-side 속성 - 테이블표제위치 (= caption-side속성 = 캡션사이드속성)
box CSS - margin-left 속성 - 요소의 왼쪽 바깥 여백 (= 바깥 좌측 여백 = 좌측마진 = 왼쪽마…
text CSS - unicode-bidi 속성 - 텍스트글자방향 (= unicode-bidi속성 = 유니코드비디속성…
responsive CSS - @media 구문 - 미디어쿼리 이용한 반응형 스타일 구현 (= media쿼리) ※ IE/Edge…
css CSS - 선택자 명시도 계산 - (CSS 적용 선택자우선순위 판별 = CSS적용순서 체크)
text CSS - text-decoration-style 속성 - 텍스트라인모양 (굵은선, 파선, 점선, 물결선 등…
border CSS - border-image 속성 - 테두리이미지 (= border-image속성 = 보더이미지속성, …
20/27
목록
찾아주셔서 감사합니다. Since 2012