gpt4 book ai didi

css - 缩写 - CSS :first-letter over two lines

转载 作者:技术小花猫 更新时间:2023-10-29 10:38:09 25 4
gpt4 key购买 nike

我正在尝试在

元素中创建大首字母,这些元素应该从第二行开始并覆盖两行,但在 firefox 中第一个字母的位置不符合我的预期(在其他任何地方都有效,即使在 IE 中,只有 FF 会出现问题...)

http://jsfiddle.net/6SfHG/1/

First letter problem

有什么想法可以让它从同一水平开始吗?

最佳答案

这对我有用,尽管它不是很优雅:

So to get a cross browser drop cap effect using :first-letter pseudo-element that ver­tic­ally aligns, you need to apply float: left, then find the height of the typeface cap height, reduce the line-height to that, adjust margin-top so it aligns cor­rectly in Fire­fox and in Opera or a Web­Kit browser, and then using con­di­tional com­ments for an IE only stylesheet remove margin-top and change line-height to cor­rectly ver­tic­ally align the type.

p::first-letter {
float: left;
font-family: Georgia, serif;
font-size: 75px;
line-height: 60px;
padding: 3px;
}

http://nickcowie.com/2009/drop-caps-first-letter-and-firefox/

关于css - 缩写 - CSS :first-letter over two lines,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10775189/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com