Odd behavior of :first-letter in Chrome

前端 未结 3 809
滥情空心
滥情空心 2021-01-21 10:08

Adding what seems to be an innocuous class to an element having a class containing :first-letter causes the first letter, under some circumstances, to be rendered incorrectly. A

3条回答
  •  甜味超标
    2021-01-21 11:09

    The pseudo element (:first-letter) only works if the parent element is a block container box (in other words, it doesn't work on the first letter of display: inline; elements.)

    You must set pseudo's parent to

    .parent {display:block}
    

提交回复
热议问题