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?
You are not logged in. Please login or register.
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?
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.
Also good thing to know is that that the only two attribute for "img" tag that are not deprecated are width and height.
Hosting provided by aTech Media