473,320 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

DIV, SPAN and align

Hi all
I have something like
<DIV style="border: 1px solid black">
<SPAN>left side text</span>
<span>right side text</span>
</div>

Using CSS I would like to aling first SPAN on left and second SPAN (on the
same line) on right side.
Using float property I can do it but, text appears outside DIV border.
What properties should I use to obtain this?
I would not use TABLE tags !

thanx
--
ShadowMan

Jul 20 '05 #1
3 39701
On Thu, 2 Sep 2004 11:26:53 +0200, ShadowMan <sh*****@despammed.com> wrote:
Hi all
I have something like
<DIV style="border: 1px solid black">
<SPAN>left side text</span>
<span>right side text</span>
</div>

Using CSS I would like to aling first SPAN on left and second SPAN (on
the
same line) on right side.
Using float property I can do it but, text appears outside DIV border.
What properties should I use to obtain this?
I would not use TABLE tags !

thanx


When you float, the content is taken out of the flow. By floating both
spans, the div has no content and therefore won't contain the floats.

You need something after the two floats, inside the div, set to clear:both
such as an element containing &nbsp;.
Jul 20 '05 #2
Els
Neal wrote:
On Thu, 2 Sep 2004 11:26:53 +0200, ShadowMan
<sh*****@despammed.com> wrote:
Hi all
I have something like
<DIV style="border: 1px solid black">
<SPAN>left side text</span>
<span>right side text</span>
</div>

Using CSS I would like to aling first SPAN on left and
second SPAN (on the
same line) on right side.
Using float property I can do it but, text appears outside
DIV border. What properties should I use to obtain this?
I would not use TABLE tags !

thanx


When you float, the content is taken out of the flow. By
floating both spans, the div has no content and therefore
won't contain the floats.

You need something after the two floats, inside the div,
set to clear:both such as an element containing &nbsp;.


Another way is to only give the first span float:left; and add
text-align:right to the containing div.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 20 '05 #3
ShadowMan wrote:
Hi all
I have something like
<DIV style="border: 1px solid black">
<SPAN>left side text</span>
<span>right side text</span>
</div>

Using CSS I would like to aling first SPAN on left and second SPAN (on the
same line) on right side.
Using float property I can do it but, text appears outside DIV border.
What properties should I use to obtain this?
I would not use TABLE tags !

thanx

Try this
1)Create a div with 2 divs in it. Float one right and one left.
I did it on the bottom of my page http://test.harryweiss.com/.

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Shel | last post by:
Sorry to bother you; in the below test, <SPAN> doesn't do the text alignment. What's wrong? Using Opera 7.50 for Windows. <HTML> <HEAD> </HEAD> <BODY> <P>regular text
3
by: kAldam | last post by:
I am currently using IE 6.0 and 5.5 and the scenario is the following. I have a span that contains text, and the span is beign contained by a table cell (this is the way thing need to be in my...
6
by: Christopher Benson-Manica | last post by:
http://ataru.gomen.org/files/html/files/test.html: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Test page</title> <style...
13
by: MrBaseball34 | last post by:
In this HTML: <html> <head> <title>Page 1</title> </head> <body style="background:#C2BFA5;"> <span style="background-color:#F9DFB2; position: absolute; border:thin inset;
2
by: Mr. Clean | last post by:
Why would this work: <html> <head> <title>Page 1</title> </head> <body style="background:#C2BFA5;"> <span style="text-align: center; border:thin inset; position:absolute; left:14px;
6
by: hsomob1999 | last post by:
so i have a <ul> and I allow the user to append items to it. The problem is that on mozilla the <span class="line"> which is just a line to divide the sections gets overlaped and doesnt move down...
9
by: developer | last post by:
Does anyone know what is the way IE treats span tags(<span>) and table tags(<tr>, <td>)? Should the <span> tag be encolsed in tds and trs if it placed with other elements that are in a table? Can...
7
by: Nez | last post by:
Help needed! Hello, I have looked everywhere for a solution to my problem and this is pretty much my last resource. I have created a table in a span with the innerhtml command in my code behind....
6
by: db | last post by:
Hello @ all, I got a problem regarding tag SPAN. Under IE, all text within tag SPAN will be centralized, whereas under FF the text stays on the left. The correponding HTML code is <span...
5
by: Brent | last post by:
Take this small HTML fragment: span.theClass{float:left;width:100px;cursor:pointer;cursor:hand;} ------------------------ <div> <span id="1" class="theClass">&nbsp;<span> <span id="2"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.