The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How do I allign text on the same line?

Go down

How do I allign text on the same line? Empty How do I allign text on the same line?

Post by Guest September 1st 2010, 4:41 am

I want to align one portion of text on the left and another portion of text on the right, all on the same line. What HTML codes can I use to do this? I tried this code here:

Code:
<div style="text-align:left"><b>Text Left Side</b><div style="text-align:right"><b>Text Right Side</b>

But this code doesnt keep the text on the same line. It 'line breaks' once the second code to align left starts..

Can anybody please help me align text on the right and on the left but on the same line?
avatar
Guest
Guest


Back to top Go down

How do I allign text on the same line? Empty Re: How do I allign text on the same line?

Post by Guest September 1st 2010, 5:50 am

This should work:

Code:
<div style="float:right;text-align:right;"><b>Text Right Side</b></div><div><b>Text Left Side</b></div>
avatar
Guest
Guest


Back to top Go down

How do I allign text on the same line? Empty Re: How do I allign text on the same line?

Post by Guest September 1st 2010, 6:44 am

Thanks Dion, that worked, is there any way i can make them more spaced apart?
avatar
Guest
Guest


Back to top Go down

How do I allign text on the same line? Empty Re: How do I allign text on the same line?

Post by ankillien September 1st 2010, 8:05 am

SPADEZ wrote:Thanks Dion, that worked, is there any way i can make them more spaced apart?

Try adding this to the code...

<div style="float:right;text-align:left;"><b>Text Right Side</b></div><div style="margin-right : 200px;><b>Text Left Side</b></div>

Change 200px as per your need.
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

How do I allign text on the same line? Empty Re: How do I allign text on the same line?

Post by Guest September 1st 2010, 6:20 pm

ankillien wrote:
SPADEZ wrote:Thanks Dion, that worked, is there any way i can make them more spaced apart?

Try adding this to the code...

Text Right Side
margin-right : 200px;>Text Left Side

Change 200px as per your need.

Hmm, thats odd, i tried that and it seems to remove my left side text but keep the link, however the link becomes so wide it takes up the entire line or a good portion of it, i tried various sizes but my left side text never displayed with this code.

Check out my forum @ www.The-EN.com and look at the chatbox iframe. Where it says "Please View The-EN Chatbox Rules: Click Here!" thats what i am trying to move to the left side of the iframe.
avatar
Guest
Guest


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum