Forum Moderators: not2easy

Message Too Old, No Replies

Horizontally Aligning IMG within DIV

         

Abbas

6:39 pm on Jul 9, 2007 (gmt 0)

10+ Year Member



I'm trying to get the image within the div to become right aligned, while keeping the text/link (ie. "hello"). Any ideas on how this can be done!?

Thanks!

<td>
<span>
</span>
<div tabindex="0" oncontextmenu="MSOWebPartPage_OpenMenu(DropDown_2862bfc1, this); return false;" onclick="alert(this); alert('1'); alert(DropDown_2862bfc1); MSOWebPartPage_OpenMenu(DropDown_2862bfc1, this); return false;" style="" onmouseout="this.className='ms-HoverCellInActive'" onmouseover="this.className='ms-HoverCellActive'" class="ms-HoverCellInActive" id="testing">
<nobr>
<a href="message.aspx?action=view&messageGid=d6248ba1-5769-45ad-9df4-b06fccc09a50&urlRef=aHR0cHM6Ly9hbW1hci0yazMucmVkbW9uZC5jb3JwLm1pY3Jvc29mdC5jb20vY29tcGFuaWVzL2RvZG9pbmMvbWVzc2FnZUZvbGRlci5hc3B4P2ZvbGRlck5hbWU9aW5ib3g=">

hello

</a>
<img align="absbottom" src="/_layouts/images/menudark.gif" alt="menu">
</nobr>
</div>

Xapti

10:31 pm on Jul 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post your relevant code.

This mean the page's doctype at the top of the page,
your relevant CSS code,
and the RELEVANT information of your HTML code.

Currently you included HTML code, but it's full of garbage that's useless to us, and just makes it harder to deal with.

"tabindex="0" oncontextmenu="MSOWebPartPage_OpenMenu(DropDown_2862bfc1, this); return false;" onclick="alert(this); alert('1'); alert(DropDown_2862bfc1); MSOWebPartPage_OpenMenu(DropDown_2862bfc1, this); return false;" style="" onmouseout="this.className='ms-HoverCellInActive'" onmouseover="this.className='ms-HoverCellActive'" class="ms-HoverCellInActive"
and
href="message.aspx?action=view&messageGid=d6248ba1-5769-45ad-9df4-b06fccc09a50&urlRef=aHR0cHM6Ly9hbW1hci0yazMucmVkbW9uZC5jb3JwLm1pY3Jvc29mdC5jb20vY29tcGFuaWVzL2RvZG9pbmMvbWVzc2FnZUZvbGRlci5hc3B4P2ZvbGRlck5hbWU9aW5ib3g="

is pretty useless information.
You also have a td which doesn't close, and an empty span.

As far as I know, what you want is text beside an image, And both of them aligned to the right?
A simple way to achieve that would be to just set your div to float:right
example: <div style="float:right">text orlinks goes here <img image goes here></div>

On a site note, it looks like you're using javascript to do rollover menus. This can be done much more efficently by using CSS styles, such as CSS rollovers using the :hover pseudo-class.

[edited by: Xapti at 10:35 pm (utc) on July 9, 2007]