Previous Message
Next Message

Re: [css-d] p:first-letter

Sent by James Aylard on 2 July 2002 14:02


Keith,

> Using background-color is a bust as IE only puts it in the space actually
> occupied by the letter whereas the other browsers put some above and below
> (at half lineheight I assume). This means that one could, for example,
> reverse color and background color for the first-letter and it looks fine
> except for IE where a T for example just appears as a vertical bar with
two
> contrasting stripes.

    You can apply padding to the first-letter pseudo class, e.g:

div#content p:first-letter {
  font-size: 150%;
  color: #ff8888;
  background-color: inherit;
  padding: 2px ;
}

    IE and Mozilla will treat this differently, giving a varied result
between the two browsers, but it does give you control over the problem you
describe.

James Aylard
Previous Message
Next Message

Possibly related: