This is probably going to sound silly, but how can i get some text on the left of the page, and on the right, but on the same line using div tags?.
Thanks
This is probably going to sound silly, but how can i get some text on the left of the page, and on the right, but on the same line using div tags?.
Thanks
use the force. or CSS. whatevers good for you.
float: left/right is the kiddie
what i mean is....
using a div tag (just one... or two if it will stay on the same line) to get 2 pieces of text, one on the left, and one on the right. but on the same line.
like:
Left text here ------------------------------------------------------------Right text here
(ignore the ------'s, its just because it doesn't like white space).
i can get things to align to the left fine, and the right. Its just i want to know how to do it on the same line. Thanks
You can do it in CSS quite easily, i just can't remember how
Something like display:inline; for each. Actually no, you have to use <span> as <div> incurs a line break iirc. Then just do float:right; and float:left; for each <span>
Thats it, cheers.Originally Posted by KeZZeR
Well it would be if span was a block level element but its not so they'll just sit side by side. All you need is one div with the left content in it and then another div embedded in that one with float:right set on it. You'll hit problems if the main div has a background and/or a border and the right div is taller than the main one as it will just overlap rather than increase the height of the main div
That probably won't make any sense if you read it but try it out and you'll see what I mean
No, that makes sense and i was wondering about that problem as i wanted to use a background image. Thanks.Originally Posted by Iain
edit: tried it out, and it just makes the text on the right flow below...
if i use the way i did before with the two span tags^^^^^^^. the background will only show where the text is, so if i use css to change the width to 100%, it works, BUT the text floating on the right then jumps down a line again.
Last edited by XA04; 16-05-2005 at 03:19 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)