zoukankan      html  css  js  c++  java
  • css3 flex实现扁图横向撑满,竖图纵向撑满

    <div class="page-video-list">
        <div class="thumbnail">
            <div class="img">
                <img src="https://aecpm.alicdn.com/simba/img/TB1XotJXQfb_uJkSnhJSuvdDVXa.jpg">
            </div>
        </div>
        <div class="thumbnail">
            <div class="img">
                <img src="https://aecpm.alicdn.com/simba/img/TB1j4LLKpXXXXcbaXXXSutbFXXX.jpg">
            </div>
        </div>
        <div class="thumbnail">
            <div class="img">
                <img src="https://img.alicdn.com/tps/i4/https://img.alicdn.com/imgextra/i3/6000000005261/O1CN01EPZf8u1ojaKW98tV1_!!6000000005261-0-octopus.jpg_240x240q90.jpg">
            </div>
        </div>
    </div>
    .page-video-list{position:relative;}
    .page-video-list .thumbnail{width:100%;padding:5px;}
    .page-video-list .img{position:relative;width:100%;height:100%;display:flex;justify-content:left;align-items:center;}
    .page-video-list .img img{max-width:100%;max-height:100%;}

    效果图:

  • 相关阅读:
    标准MIDI文件格式
    David's MIDI Spec
    国庆长假好读书
    vim用法
    ,非你莫属,
    子宫的满足,睡觉前,
    在哪里,
    黑条,
    下单 返回的字段,
    机会啊,游戏啊,转吧,
  • 原文地址:https://www.cnblogs.com/gongshunkai/p/13813419.html
Copyright © 2011-2022 走看看