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

[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

 


분류 제목
css CSS - 이미지 세로 나열 (= 수직 정렬) 방법/경우/원인/이유
flex CSS - order 속성(I) - 아이템 순서 재조정 (= order속성 = 오더속성, IE11) ※ 플렉…
func CSS - rgb() 함수 - (빨강,녹색,파랑)으로 색상 정의. (= rgb함수 = 알지비함수)
list CSS - list-style 속성 ★ - 리스트 스타일 일괄 (= 리스트마커 = list-style속성 =…
func CSS - rgba() 함수 ★ - (빨강,녹색,파랑,불투명도)으로 색상 정의. (= rgba함수 = 알지비…
intro CSS - 정의・장점・구문・초기화 + 주석
animation CSS - animation-duration 속성 - 애니지속시간 (= 애니완료소요시간 = 움직임완료소요시간…
func CSS - hsla() 함수 - (색조, 채도, 밝기, 불투명도)로 색상 정의. (= hsla함수 = 에이치…
css CSS - 블럭요소 수직중앙정렬/수평중앙정렬 (= 가로가운데정렬) (IE9) ★★★★★ (HT - Cent…
css CSS - zoom 속성 - 요소 확대 (= zoom속성 = 줌속성) ※ IE 하위 브라우저(예: IE6, …
flex CSS - align-self 속성(I) ★ - 교차축 기준으로, 아이템 자체 정렬. (= align-sel…
transform CSS - transform 속성 ★ - 요소 (회전/비틀기/크기확대) 변환 + 마우스 허버 시 줌효과 (=…
selector CSS - ::after 가상선택자 ★ - 요소 뒤에 내용삽입 (= ::after선택자 = 에프터선택자/애프…
text CSS - text-emphasis 속성 - 텍스트 강조마크의 '모먕/색깔' 일괄 지정 (= 텍스트 글자 위…
box CSS - margin-top 속성 - 바깥여백상단 (= margin-top속성 = 마진탑속성 = 마진톱속성…
responsive CSS - RES Video - (반응형 동영상)
selector CSS - element~element 형제선택자 ★★ - 지정요소 뒤의 모든 특정형제요소 (요소선택자군…
border CSS - border-top 속성 - 테두리상단일괄 (= border-top속성 = 보더탑속성 / 보더톱속…
table CSS - table-layout 속성 ★★★ - 테이블 셀, 행 및 열을 레이아웃 (= table-layo…
selector CSS - element,element 병렬선택자 ★ - 쉼표로 나열된 여러 요소 선택. (= 여러 요소선택…
21/27
목록
찾아주셔서 감사합니다. Since 2012