Hi:
I searched the forum before posting and could not find any help on how
to position an image using image_tag (''image_name'').
I have an image in a div, and I need to move it to the right.
How do I this? I have this code:
<div id="mainDivright"><%= image_tag
(''name.gif''), :options =>
{:align=>"right" } %></div>
I even tried this:
<div align="right" id="mainDivright"><%= image_tag
(''name.gif'') %></
div>
and it does not seem to work.
Thanks in advance for taking the time to answer.
On Sun, Oct 25, 2009 at 11:49 AM, about2flip <mnusom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi: > > I searched the forum before posting and could not find any help on how > to position an image using image_tag (''image_name''). > > I have an image in a div, and I need to move it to the right. > > How do I this? I have this code: > > <div id="mainDivright"><%= image_tag (''name.gif''), :options => > {:align=>"right" } %></div> > > I even tried this: > > <div align="right" id="mainDivright"><%= image_tag (''name.gif'') %></ > div> > > and it does not seem to work.How would you do that on plain HTML? you should check your generated HTML and compare it wth your plain HTML solution. image_tag does nothing but generate an HTML <img /> tag with the attributes you give as parameters. Check the rdoc for image_tag to see what are those parameters. -- Leonardo Mateo. There''s no place like ~
add to your css stylesheet:
#mainDivright { float: right; }
On Oct 25, 10:49 am, about2flip
<mnu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi:
>
> I searched the forum before posting and could not find any help on how
> to position an image using image_tag (''image_name'').
>
> I have an image in a div, and I need to move it to the right.
>
> How do I this? I have this code:
>
> <div id="mainDivright"><%= image_tag
(''name.gif''), :options =>
> {:align=>"right" } %></div>
>
> I even tried this:
>
> <div align="right" id="mainDivright"><%=
image_tag (''name.gif'') %></
> div>
>
> and it does not seem to work.
>
> Thanks in advance for taking the time to answer.
Just a little more elaboration...
I''m assuming your view contains:
<%= image_tag (''name.gif''), id="mainDivright"
%>
If you check the html produced using firebug you should see something
like:
<img id="mainDivright" src=...
The css stylesheet can key off this id.
On Oct 25, 12:43 pm, Rick
<richard.t.ll...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> add to your css stylesheet:
>
> #mainDivright { float: right; }
>
> On Oct 25, 10:49 am, about2flip
<mnu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > Hi:
>
> > I searched the forum before posting and could not find any help on how
> > to position an image using image_tag (''image_name'').
>
> > I have an image in a div, and I need to move it to the right.
>
> > How do I this? I have this code:
>
> > <div id="mainDivright"><%= image_tag
(''name.gif''), :options =>
> > {:align=>"right" } %></div>
>
> > I even tried this:
>
> > <div align="right" id="mainDivright"><%=
image_tag (''name.gif'') %></
> > div>
>
> > and it does not seem to work.
>
> > Thanks in advance for taking the time to answer.