Day 86: the initial-letter property

The initial-letter property specifies size and sink for initial letters.

@supports (-webkit-initial-letter: 1) or (initial-letter: 1) {
  p::first-letter {
    -webkit-initial-letter: 3;
    initial-letter: 3;
  }
}

The property takes two arguments. The first one defines the size of the initial letter in terms of how many lines it occupies. The optional second argument defines the number of lines the initial letter should sink. If it’s omitted, it equals the initial letter size.

  p::first-letter {
    initial-letter: 2;
  }

1 as the second argument indicates a raised initial.

  p::first-letter {
    initial-letter: 2 1;
  }

The first letter in a paragraph spans 2 lines starting at the first line and going up ending one line above the first line."

Values greater than 1 indicate a sunken initial letter.

  p::first-letter {
    initial-letter: 2 5;
  }

The first letter in a paragraph spans 2 lines starting at the fourth line and ending at the fifth line."

Note: This property is currently only supported in Safari with a prefix, but it’s coming to Chromium browsers soon.

My blog doesn’t support comments yet, but you can reply via [email protected].