Is there a way to scale down an image only if width is higher than XX pixels,开发者_高级运维 in HTML/CSS ?
You can use max-width or max-height to specify the largest you want the image to be.
live demo
References
https://developer.mozilla.org/En/CSS/Max-height
https://developer.mozilla.org/En/CSS/Max-width
As noted in the comments this is not supported in IE6 or below.
Use max-width in your css to fix a maximum image width and don't specify your image height. This way your image should stay proportionnal and respect a max width.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论