2017年12月31日 星期日

2017年12月7日 星期四

在html使用類似background-size的效果

http://www.zhangxinxu.com/wordpress/2015/03/css3-object-position-object-fit/

.box { width: 160px; height: 160px; margin: 10px 0 20px; background-color: #beceeb; overflow: hidden; resize: both; }
.box > img {width: 100%; height: 100%; background-color: #cd0000;}
.fill { object-fit: fill; }
.contain { object-fit: contain; }
.cover { object-fit: cover; }
.none { object-fit: none; }
.scale-down { object-fit: scale-down; }
Share:
Read More

2017年12月4日 星期一

梯形

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <div class="trapezoid">
  </div>
</body>
</html>


.trapezoid{
   background-image: url(../image/bg.jpg);
   color: white;
    width: 0;
    border-left: 1600px solid transparent;
    border-bottom: 50px solid white;
}


Share:
Read More

2017年12月3日 星期日