How to set max width of an image in CSS

前端 未结 6 628
陌清茗
陌清茗 2020-12-08 06:00

On my website I would like to display images uploaded by user in a new window with a specific size (width: 600px). The problem is that the images may be big. So

6条回答
  •  温柔的废话
    2020-12-08 06:49

    You can write like this:

    img{
        width:100%;
        max-width:600px;
    }
    

    Check this http://jsfiddle.net/ErNeT/

提交回复
热议问题