<head> 内に jquery ファイルと一緒に jquery.backgroundSize.js ファイルを設置しますが、IE8 以下に対応させるので <!–[if lte IE 8]> で括るようにします。 <script src="./jquery.min.js"></script> <!--[if lte IE 8]> <script src="./jquery.backgroundSize.js"></script> <script> $(function() { $("div.contents").css({backgroundSize: "contain"}); }); </script> <![endif]--> .contents の要素に対してCSS3 の background-size:contain を適用させる例です。 <style> .contents { w
![[JS]IE7、8でも background-size:contain が利用できるjQueryプラグイン「jquery.backgroundSize」|CSSプロパティ|WEBデザインの小ネタとTIPSのまとめサイト「ウェブアンテナ」](https://cdn-ak-scissors.b.st-hatena.com/image/square/9e3075ed41a5eaca8cfb24739fffc8b6b8ebbc2b/height=288;version=1;width=512/https%3A%2F%2Fwww.webantena.net%2Fwp-content%2Fuploads%2F2013%2F09%2Fjquerybackgroundsize.png)