Getting WordPress to Play nice with Responsive Images

Using WordPress with responsive images

Having recently rebuilt his personal blog on WordPress using a responsive, mobile-first approach David Smith was familiar with some of the techniques covered in the article of Jesse Friedman. However, the one item that really stood out for him was Jesse’s approach to enabling fluid images via jQuery.

 

David Smith is sure you’re all aware 'fluid images'  – which make use of max-width: 100% – require that images have no fixed width or height in order that they can scale to the size of their container. Unfortunately, WordPress automatically calculates the dimensions of images generated from the Media library and adds the corresponding width and height attributes to any <img> tags.

Comments

Be the first to write a comment

You must me logged in to write a comment.