Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

align an image against the top right hand side of the page

Status
Not open for further replies.

LaPluma

Programmer
Feb 3, 2002
139
0
0
DE
Hello

I am writing to ask for some advice on how to align an image so that it is tightly ditted against the top right of the Web page.

I have this:

<div align=right><img SRC=&quot;legs1.jpg&quot; NAME=&quot;legs1.jpg&quot; BORDER=0 height=407 width=271 valign=TOP></div>

but it doesn't seem to work.

Best wishes

LaPluma

 
You need to set top and right margins to 0

<body topmargin=0 right margin=0 marginwidth=0 marginheight=0> DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
<body topmargin=0 right margin=0 marginwidth=0 marginheight=0>


is not W3c compliant and rightmargin=0 isn't even an attribute.

USE CCS (between your head tags)

<style type=&quot;text/css&quot;>
<!--
body { margin:0;}
-->
</style>

The only thing that should be in your body tag are your text and link colors.
 
Hello DeZiner and WizyWyg

Many thanks to you both for your replies.

They both work! Great!

Best wishes

LaPluma
 
You can also absolutely position the element:

<style>
.righty {position:absolute; top:0px;right:0px;}
</style>


<body>
<table width=&quot;500&quot;>
<tr>
<td>Hey</td>
<td>I am</td>
<td>Not colored</td>
</tr>
<tr>
<td>Hey</td>
<td>I am</td>
<td>Not anything</td>
</tr>
<tr>
<td>Hey</td>
<td>I am</td>
<td>Not colored</td>
</tr>
</table>
<div class=&quot;righty&quot;>Top Right</div>
</body> JimS.
aka
TenTonJim

Looking for work:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top