Responsive Web Design

bravoman2

New Member
Does anyone have expertise with Responsive websites? Or to convert them to HTML 5 particularly if it is wordpress. I have tried a wordpress theme which is responsive, but it breaks the images. Any help would be great. Thanks.
 

Phreaddee

Super Moderator
Staff member
actually it should be max-width:100% and height:auto; by leaving the height out it will more than likely warp the image out of it's original ratio.
 

ronaldroe

Super Moderator
Staff member
actually it should be max-width:100% and height:auto; by leaving the height out it will more than likely warp the image out of it's original ratio.

This will work for template images, but you need to go one step further for content images, since WP adds the width and height attributes. The easiest way is a bit of jQuery:

Assuming your content area has a class of .post and jQuery 1.7 or higher:
Code:
$(function(){
  $('.post img').removeAttr("height width");
});

I've seen it done with PHP in functions.php, but I don't know how off the top of my head, plus that won't do anything for previously added images, whereas the jQuery option will.
 
Last edited:
Top