PureCss Responsive Images

2019-06-14 10:23发布

I am just trying to do my first page using purecss, what I am stuck at the moment is in using pure-img for having responsive images, the image are responsive when I reduce the screen but when the screen become bigger and the image are supposed to increase from their original dimension they just stay static in their original size.

Can you please help me :)

2条回答
我命由我不由天
2楼-- · 2019-06-14 11:00

The simplest way - just append width: 100% on your image.

https://jsfiddle.net/zv95xt4r/

查看更多
做个烂人
3楼-- · 2019-06-14 11:09

Try:

img {
  max-width: 100%;
  height: auto;
}
查看更多
登录 后发表回答