|
Posted by John Salerno on 02/11/06 22:01
Beauregard T. Shagnasty wrote:
> John Salerno wrote:
>
>> If I have a div with some text in it (a date and a time), and I want
>> the date left-aligned (default) and the time right-aligned with the
>> right side of the div, how would I do that?
>>
>> I put spans around the date and time and gave them each a class of
>> .date and .time, and for time I did:
>>
>> .time {
>> text-align: right;
>> }
>
> You need to use floats. See the source of this page of mine.
> http://k75s.home.att.net/banner.html
>
Excellent! float left and right did what I needed. But a quick question:
before I did float: left for the date (since it was already left-aligned
anyway), I did float: right for the time, and this caused it to not only
be moved to the right, but also down a little so that it wasn't lined up
on the same line as the date. But after I added float:left for the date,
this moved the time back up and re-aligned them. Why would it do that?
Thanks again!
[Back to original message]
|