how to resize images in your blogger post ?

helpful tip
 In your post ,if image's size larger than layout ,it will be overfloat ,and break the design of your blog .
To fix this problem ,we can set a maximum size for images in your post  .If image size larger than this value ,image will be resize automatically ,but still keep proportion .


How to do it ?

Just as this code in style section of your template . Find the line <b:skin><![CDATA[/* and insert this code right after :

img {
max-width: 480px;
width: expression(this.width > 480 ? 480: true);
border: none;
text-align: center;
}

in the code above ,480 is the maximum width of images . Set this value depend on your need .
You can change width to height to set the max-height of images .

Share this post

Advertisement

2 comments

  1. how to do it this for videos,bacause i dont have photos just videos any guess?

    ReplyDelete
  2. if you insert videos in your blog ,you have to use embed tag . So you just need to use this css code :

    embed {
    max-width: 480px;
    width: expression(this.width > 480 ? 480: true);
    }

    just change the width for your website .They are attributes for embed tags .

    ReplyDelete