Jump to content

Align


onthespot

Recommended Posts

OK this is doing my head in!

I cant get this to align how I want it to.

 

<img src="images/news/sdasdasdasdas.jpg" align="right">

<h1><a href='newspiece.php?news=72'>sdasdasdasdas
</a></h1>

<p>dasdasdasdasdasdasdas <a href='newspiece.php?news=72'>..[read more]..</a>
</p>

<h5>Posted by <a href="userprofile.php?user=Luke">Luke</a> on August 8th 2009
</h5>
</img>

 

And....

 

<table>
<tr>
<td><img src="images/news/sdasdasdasdas.jpg" /></td>
</tr>
<tr>
<td><h1><a href='newspiece.php?news=72'>sdasdasdasdas
</a></h1></td>
</tr>
<tr>
<td><p>dasdasdasdasdasdasdas <a href='newspiece.php?news=72'>..[read more]..</a>
</p></td>
</tr>
<tr>
<td><h5>Posted by <a href="userprofile.php?user=Luke">Luke</a> on August 8th 2009

</h5></td>
</tr>
</table>

 

I have tried both of these methods, and neither work.

I want it to have the image on the right, and the text with just be on the left of it.

Link to comment
Share on other sites

try to avoid using tables for layout... try something like this

 

<div>
<div style="float:right">
<img src="images/news/sdasdasdasdas.jpg" />
</div>
<div style="text-align:right">
<h1><a href='newspiece.php?news=72'>sdasdasdasdas
</a></h1>

<p>dasdasdasdasdasdasdas <a href='newspiece.php?news=72'>..[read more]..</a>
</p>

<h5>Posted by <a href="userprofile.php?user=Luke">Luke</a> on August 8th 2009
</h5>
</div>
</div>

 

is that what you wanted?

Link to comment
Share on other sites

<div>
<div style="float:right">
<img src="images/news/sdasdasdasdas.jpg" />
</div>
<h1><a href='newspiece.php?news=72'>sdasdasdasdas
</a></h1>

<p>dasdasdasdasdasdasdas <a href='newspiece.php?news=72'>..[read more]..</a>
</p>

<h5>Posted by <a href="userprofile.php?user=Luke">Luke</a> on August 8th 2009
</h5>
</div>

 

this puts the image and the text in a div, with the image floating to the right...

Link to comment
Share on other sites

i tried the same code on a test page and it worked for me.... unless there isn't space for the text? i dont know, see if this works i guess

 

<div>
<img src="images/news/sdasdasdasdas.jpg" style="float:right" />
<h1><a href='newspiece.php?news=72'>sdasdasdasdas
</a></h1>

<p>dasdasdasdasdasdasdas <a href='newspiece.php?news=72'>..[read more]..</a>
</p>

<h5>Posted by <a href="userprofile.php?user=Luke">Luke</a> on August 8th 2009
</h5>
</div>

 

 

although i don't know your final goal as far as context... if you are doing something you would like to be able to change styles on easier or whatever, it would be better to have an external style sheet do all the styling

 

this is a page i just tested both this code as well as the previous here, does that come out right for you?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.