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

left AND right align in one line please? 1

Status
Not open for further replies.

elck

Programmer
Apr 19, 2004
176
NL
Hi I use
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]

and am trying to achieve one line with one part left aligned and the other right aligned.

For instance:
Code:
<div width=80%>
   <span style="display:inline-block;text-align:left">
      text left
   </span>
   <span style="display:inline-block;text-align:right">
      text right
   </span>
   <img src=s width=x height=y>

</div>
which does not seem to be working.
 
Thanks for putting me straight on that.
Now do you also have a solution for me please?
 
sorry, just assumed you were asking why that code didn't work.

if you want text on the same horizontal line you need to use floats on the span and a float on the image assuming you are wanting the text either side of the image.

Code:
<div width=80%>
   <span style="float:left;text-align:left">
      text left
   </span>
   <span style="float:right;text-align:right">
      text right
   </span>
<img style="float:left;clear:right;" src=s width=x height=y>
</div>

Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Thanks, that does the trick!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top