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

Hi,

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.

http://www.w3.org/TR/REC-html40/struct/ … tml#h-13.7

http://www.w3schools.com/tags/tag_IMG.asp