[thelist] quick css text layout float?

rudy rudy937 at rogers.com
Thu Jul 17 06:05:36 CDT 2003


> this looks like the solution, however is there something for the first two
> letters etc
>
> p {font-size: 12pt}
> p:first-letter {font-size: 200%; float: left}
> <p>The first words of an article.</p>


one nice thing about   :first-letter  is that it requires absolutely no
markup in the actual document

(at the risk of setting off another flame-fest about font size, i should
like to point out -- no pun intended -- that points should only be used for
print style sheets, not display, and that 200% will not necessarily give you
14 -- points or pixels -- as you indicated in your first email)

but the first two letters? i'm afraid you will have to introduce some kind
of markup

to wit --

     <something>ab</something>cdefg

now, many people will suggest that you use <span> for this purpose, give it
a class (or locate it as a descendent selector or whatever it's called), and
then apply the necessary style in the stylesheet

at the risk of setting off another flame-fest about markup and
deprecation -- a much more fruitful one, in my opinion -- i will suggest
that a good choice for markup in this situation is

    <big>ab</big>cdefg

because it require no style (unless you want to override the browser's
default) and is furthermore supported even by browsers that don't do style
sheets

rudy




More information about the thelist mailing list