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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

image alignment problem 1

Status
Not open for further replies.

MrTom

Programmer
Mar 13, 2001
383
GB
i've done a page that contains news posts.

each posts has a heading and then the body with an accompanied image which sits either on the left or right of the text.

my problem is that if there is not a lot of text - so the bottom of the image is below the end of the text - a browser will start the next post too quikly so the image overlaps the heading.

i position the image using

<img src=&quot;test3.jpg&quot; align=&quot;right&quot;>

and then follow with the text.

before anyone says tables - don't! ;) i want to do this without tables.
 
You will have to use plain line breaks <br> to overcome this. However if the post is long enough the next will start too far down because the line breaks will always be there.

If you are using javascript, coldfusion, asp or something to that effect you can use an if/else statement to insert the breks only when the post is say 10 words long.

I am going to assume that is not an option for you however if you are not comfortable with tables.

Try the <br> tag add as many as it takes.

Good Luck!
 
hmmm...

i'm gonna have to write a dirty hack for this :) i can control the output a little server side. it just surprised me when it happened - since the image is inside a <p> and this makes two <p>'s overlap.

i can't use the tables tho cos this has got to look completely different when it's in fullscreen or printed or in a few other modes.

thanks for the suggestions tho!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top