Previous Message
Next Message

Re: [css-d] align some text to right

Sent by Dougal Campbell on 11 February 2002 13:01


On Fri, 8 Feb 2002, Eric A. Meyer wrote:

> At 16:49 -0600 2/8/02, Dougal Campbell wrote:
> 
> >I don't think you can float inline elements like span.
> 
>     Sure you can.  You can float anything your browser will let you 
> get away with, since CSS says 'float' applies to all elements (except 
> those which have been positioned, and any generated content).
>     I'd have approached the problem like this:
> 
>     <p class="title">
>     <span style="float:right;"> Michael Collins</span>
>     <span style="float:right;"><a href="default.html">Return to Home</a></span>
>     </p>
> 
> The main problem is with browsers that treat float as "float down to 
> the top of the next line" instead of "float to the side and align 
> with the top of this line."  I think IE5.x is one such browser, but 
> I'm not 100% certain there.

Well, damn. That's what I get for speaking without double-checking the 
spec first. Though, John Brooks did point out to me that we're supposed 
to specify the width for floats:
  http://www.w3.org/TR/REC-CSS2/visuren.html#floats

I dunno why that should be. Seems to me that there's no harm in letting 
the browser automagically figure out widths, if none are specified 
(which is what seems to happen, anyhow). 

-- 
Ernest MacDougal Campbell III, MCP+I, MCSE [EMAIL-REMOVED]>
http://dougal.gunters.org/             http://spam.gunters.org/
  Web Design & Development:  http://www.mentalcollective.com/
       This message is guaranteed to be 100% eror frea!
Previous Message
Next Message

Message thread: