At approximately 2006/09/21 15:46, Sjef Janssen typed these characters:
>Is it possible to have a box (div) which sets a background-color and which
contains (on the same line) text which is left aligned and text which is
right aligned. (as in a table: two td's left one left aligned, right one
right aligned).
Thanxs!!
How about a div containing two divs. The inner divs could be aligned
separately
sample below has a different color border around each box but share the
same background color.
Gil
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Alignmen t test</title>
<style>
#container{back ground-color:pink;bord er:1px solid black; width:220px}
#left {margin:0;paddi ng:0;border:1px solid blue;width:100p x;
text-align:left; display:block; float:left;}
#right {margin:0;paddi ng:0;border:1px solid red;width:100px ;
text-align:right; display:block; float:right;}
</style>
</head>
<body>
<div id="container" >
<div id="left">This text should be aligned to the left</div>
<div id="right">But this text should be aligned to the right</div>
</div>
</body>
</html>