onthespot Posted August 10, 2009 Share Posted August 10, 2009 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 https://forums.phpfreaks.com/topic/169616-align/ Share on other sites More sharing options...
smerny Posted August 10, 2009 Share Posted August 10, 2009 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 https://forums.phpfreaks.com/topic/169616-align/#findComment-894855 Share on other sites More sharing options...
onthespot Posted August 10, 2009 Author Share Posted August 10, 2009 I changed the text align to left But I get the image higher than the text I want the text on the left and the image on the right. Thankyou Link to comment https://forums.phpfreaks.com/topic/169616-align/#findComment-894866 Share on other sites More sharing options...
smerny Posted August 10, 2009 Share Posted August 10, 2009 <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 https://forums.phpfreaks.com/topic/169616-align/#findComment-894873 Share on other sites More sharing options...
onthespot Posted August 10, 2009 Author Share Posted August 10, 2009 Again it puts the text too low down. You have the image on the right, and the text to the left of the bottom of the image. Link to comment https://forums.phpfreaks.com/topic/169616-align/#findComment-894893 Share on other sites More sharing options...
smerny Posted August 10, 2009 Share Posted August 10, 2009 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 https://forums.phpfreaks.com/topic/169616-align/#findComment-894915 Share on other sites More sharing options...
infiniteacuity Posted August 10, 2009 Share Posted August 10, 2009 Can you provide a link to the see your code in action? Link to comment https://forums.phpfreaks.com/topic/169616-align/#findComment-894954 Share on other sites More sharing options...
onthespot Posted August 10, 2009 Author Share Posted August 10, 2009 I have fixed it now, placed the img tag after the h1. Link to comment https://forums.phpfreaks.com/topic/169616-align/#findComment-895133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.