IEのせいで しばらく設定せねばならぬ。orz
IE11が2020年11月ごろまでサポートされてるので、それまでの我慢。
【ofi.js】のCDN。
https://cdnjs.cloudflare.com/ajax/libs/object-fit-images/3.2.3/ofi.js
スクリプト
<script>objectFitImages();</script>
css
.hoge img { width: 100px; height: 100px; object-fit: cover; font-family: 'object-fit: cover;'; /*IE対策*/ }
「font-family」の記述がポイント。
「contain」なら、font-familyも「contain」へ。
コメント