> ## Content Index
> Fetch the complete content index at: https://blog.skitisu.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Wordpress中怎样让图片自动缩放（自适应）
- URL: https://blog.skitisu.com/wordpresszhong-zen-yang-rang-tu-pian-zi-dong-suo-fang--zi-gua-ying--/
- Published: 2013-05-12T03:43:15.000Z
- Updated: 2013-05-12T03:43:15.000Z
- Author: SkiTiSu
- Tags: 探索, 网站, #Import 2026-10-21 14:41

昨天在发一些照片的时候遇到了一些问题，照片全是原图传上来的，图片全部超出框架了。在网上找到的大都只能缩放宽。终于经过不懈努力，找到了自动按原比例缩放的代码，只要将它添加到样式表（style.css）里面就可以了。（在 仪表盘→外观→编辑 中）

p img {
	padding: 0;
	max-width: 100%;
	height:auto;
}

但是需要注意的是，height:auto;对IE8以下的浏览器没有用，但是鉴于webkit内核的普及程度，在此也就不多说兼容老IE的方法，如果你确实需要，参考下面的文章：  
[WordPress技巧：jQuery实现文章图片自动缩放（支持IE）](http://www.ipeld.net/archives/4094.html?ref=blog.skitisu.com)  
当然也可以简单粗暴的装个插件就OK了，本站用的是Lightbox Plus。