LoginSignup
6

More than 5 years have passed since last update.

CSS 文章の一文字目の大きさを変える(ドロップキャップ)

Last updated at Posted at 2016-01-25

sample0.png

<p class="text">First-letter で要素内の一文字目に対してスタイルを適用できます。</p>
.text{
  width: 20em;
}

.text:first-letter{
  /*float: left;*/
  font-size: 3em;
  line-height: 1;
  color: red;
}

floatを指定すると

sample.png

文字が回り込みます。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6