Getting image to stretch a div

前端 未结 7 446
被撕碎了的回忆
被撕碎了的回忆 2021-02-04 00:34

How can I get an image to stretch the height of a DIV class?

Currently it looks like this:

7条回答
  •  北荒
    北荒 (楼主)
    2021-02-04 01:04

    Try the following:

    .Strech
    {
        background:url(image.jpg);
        background-size:100% 100%;
        background-repeat:no-repeat;
    
        width:500px;
        height:500px;
    }
    

提交回复
热议问题