Resize images and videos to fill their parent and maintain their aspect ratio with pure CSS. The new object-fit and object-position properties allow you to scale images and videos, much like you could with background-size and background-position.

img {
width: 90vw;
height: 75vh;
border: 3px solid tomato;
} .img-con1 img{
object-fit: fill;
}
.img-con2 img{
object-fit: contain;
}
.img-con3 img{
object-fit: cover;
}
.img-con4 img{
object-fit: none;
} .img-con5 img{
object-fit: scale-down;
} .img-con6 img{
object-fit: fill;
object-position: 20px 5px;
} /* Demo styles only */
* {
box-sizing: border-box;
} body {
margin:;
}

最新文章

  1. composer的安装以及laravel框架的安装(一)
  2. Openfire on Centos7
  3. Window远程连接Linux系统(CentOS7)
  4. 我和Java有个约定
  5. Maven+druid+MyBatis+Spring+Oracle+Dubbo开发环境搭建
  6. Reading package lists... Error! 解决方案
  7. hdu 3722
  8. js window.onload事件
  9. Spring AOP面向切面编程的实现
  10. SQL Server判断是否满足日期格式(YYYYMMDD)以及中文等判断,格式化为YYYY-MM-DD
  11. 织云Lite发布:详解包管理核心能力
  12. Junit-4.1.2 @Test 使用
  13. NOIP2018Day1T2 货币系统
  14. [android] 安卓进程优先级&为什么使用服务
  15. 细说JDK日志组件
  16. PHP函数之dirname()
  17. linux git patch 和patch以及git diff 命令
  18. CentOS6.5安装sqoop2
  19. Shell 基础知识和总结
  20. 12-简单认识下margin

热门文章

  1. 【canvas】跟随鼠标的星空连线
  2. centos7 docker镜像源设置
  3. 洛谷——P1307 数字反转
  4. Tomcat之——配置项目有虚拟路径
  5. 怎样在nat方式的虚拟机下做ssh连接
  6. launcher- 第三方应用图标替换
  7. activity-启动动画的设定(下面弹出出现,弹入下面消失)
  8. 求第k大的数(用到快速排序算法的思想)
  9. POJ 1874 畅通工程续(最短路模板题)
  10. Codefroces 831B Keyboard Layouts