댓글 목록

CSS 갤러리(Image Gallery)

페이지 정보

작성자 운영자 작성일 17-10-29 19:26 조회 1,541 댓글 0

동영상 강좌는 유튜브 채널 '웹학교'를 이용하시기 바랍니다.

CSS를 사용하여 이미지 갤러리를 만들 수 있습니다.


<div class="gallery">
  <a target="_blank" href="https://picsum.photos/id/1015/6000/4000">
    <img src="https://picsum.photos/id/1015/6000/4000" alt="demo1" width="600" height="400">
  </a>
  <div class="desc">갤러리 만들기#1</div>
</div>

<div class="gallery">
  <a target="_blank" href="https://picsum.photos/id/1011/5472/3648">
    <img src="https://picsum.photos/id/1011/5472/3648" alt="demo2" width="600" height="400">
  </a>
  <div class="desc">갤러리 만들기#2</div>
</div>

<div class="gallery">
  <a target="_blank" href="https://picsum.photos/id/1018/3914/2935">
    <img src="https://picsum.photos/id/1018/3914/2935" alt="demo3" width="600" height="400">
  </a>
  <div class="desc">갤러리 만들기#3</div>
</div>

<div class="gallery">
  <a target="_blank" href="https://picsum.photos/id/1024/1920/1280">
    <img src="https://picsum.photos/id/1024/1920/1280" alt="demo4" width="600" height="400">
  </a>
  <div class="desc">갤러리 만들기#4</div>
</div>



div.gallery {
  margin: 5px;
  border: 1px solid #ccc;
  float: left;
  width: 180px;
}

div.gallery:hover {
  border: 1px solid #777;
}

div.gallery img {
  width: 100%;
  height: auto;
}

div.desc {
  padding: 15px;
  text-align: center;
}



댓글목록 0

등록된 댓글이 없습니다.

CSS Flexbox강좌

CSS Variables강좌 

CSS Grid강좌