1 Sept 2015

CSS Drop Caps

CSS Drop Caps

Drop Caps can easily be styled by taking advantage of the CSS pseudo-element :first-letter.
1p:first-letter {
2    displayblock;
3    floatleft;
4    margin5px 5px 0 0;
5    colorred
6    font-size1.4em;
7    background#ddd;
8    font-familyHelvetica;
9}
This should work in all modern browsers. CSS3 introduces the ::first-letter notation to distinguish between pseudo-elements and pseudo-classes, but this new notation is not yet compatible with IE. For now use the single :first-letter notation.
Share:

0 comments:

Post a Comment