/*
 * @Author: changchang
 * @Date: 2018-12-27 17:00:41
 * @LastEditors: changchang
 * @LastEditTime: 2018-12-29 01:05:11
 * @Description: 
 */

 /*公用*/
 
.common{
  width: 300px;
  height: 200px;
  display: flex;
  display: -webkit-flex;
  float: left;
  justify-content:center;
  align-items: center;
  box-sizing: border-box;
  padding: 0 50px;
}

/*demo1*/

.demo1 div{
  width: 200px;
  height:133px;
  overflow: hidden;
  cursor: pointer;
}

.demo1 div img{
  width: 100%;
  transition: all .5s ease;
  -moz-transition: all .5s ease; /* Firefox 4 */
  -webkit-transition: all .5s ease; /* Safari 和 Chrome */
  -o-transition: all .5s ease; /* Opera */
}

.demo1 div img:hover{
  transform: scale(1.2);
}

/*demo2*/

.demo2 div{
  width: 200px;
  cursor: pointer;
  text-align: center;
}

.demo2 div img{
  display: inline-block;
  width: 200px;
  height: 133px;
  position: relative;
  /* 隐藏Firefox alt文字 */
  color: transparent;
  overflow: hidden;
}

.demo2 div img:not([src]){
  visibility: hidden;
}

.demo2 div img::after{
  content: attr(alt);
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  font-size: 12px;
  line-height: 1.5;
  background: rgba(0,0,0,.5);
  color:white;;
  transform: translateY(100%);
  transition: all .2s;
  visibility: visible;
}

.demo2 div img::before {
  /* 淡蓝色占位背景 */
  content: "";
  position: absolute; left: 0;
  width: 100%; height: 100%;
  background-color: #f0f3f9;
  visibility: visible;
}

.demo2 div img:hover::after{
  transform: translateY(0);
}

/*demo3*/

/*demo2*/

.demo3 div{
  width: 200px;
  cursor: pointer;
  text-align: center;
}

.demo3 div img{
  display: inline-block;
  width: 200px;
  height: 133px;
  position: relative;
  /* 隐藏Firefox alt文字 */
  color: transparent;
  overflow: hidden;
}

.demo3 div img:not([src]){
  visibility: hidden;
}

.demo3 div img::after{
  content: attr(alt);
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  font-size: 12px;
  line-height: 1.5;
  background: rgba(0,0,0,.5);
  color:white;;
  transform: translateY(100%);
  transition: all .2s;
  visibility: visible;
}

.demo3 div img::before {
  content: "";
  background: url(../images/duck.jpg);
  background-size: cover;
  position: absolute; left: 0;
  width: 100%; height: 100%;
  visibility: visible;
}

.demo3 div img:hover::after{
  transform: translateY(0);
}

/*demo4*/

.demo4 div{
  width: 200px;
}

.demo4 div img{
  width: 100%;
}

.demo4 div img:hover{
  content:url("../images/duck.jpg");
}