Mosaic of images HTML/CSS

后端 未结 10 1323
情书的邮戳
情书的邮戳 2020-11-29 03:53

I want to make an image layout with portrait images inside a div with a fixed aspect ratio of 3:2. The size of images is 327

10条回答
  •  囚心锁ツ
    2020-11-29 04:08

    Try something like this

    Styling

    body{
        background: black;
        width:80%;
        margin:5em auto;
        display:block;
    }
    .wrapper{
        background:#FFF;
        float:left;
    }   
    
    .container{
        height:476px;
        width:192px;
        display:inline-block;
        float:left;
    }
    .small{
        height:188px;
        width:125px;
        display:block;
        margin:0 auto;
        background:#333;
    }
    .medium{
        background:#666;
        width:192px;
        height:288px;
    }
    .large{
        height:476px;
        width:200px;
        background:#999;
        display:inline-block;
        float:left;
    }
    

    This is HTML

提交回复
热议问题