Topic: Image alignment

When i use
<%= image_tag "cutout.jpg" %>

I don't know the code to resize or to adjust the image at a particular position. Is there any way to do this. or we have to use CSS for this?

Re: Image alignment


You can use a few methods:

<%= image_tag("avatar.png", :height => '32', :width => '32', :align => 'left') %>
<%= image_tag("avatar.png", :size => '32x32', :align => 'left') %>

However, it is generally recommended to do most layout work with CSS as opposed to HTML.

Re: Image alignment

Also good thing to know is that that the only two attribute for "img" tag that are not deprecated are width and height. … tml#h-13.7