我正在尝试在 CSS 中从 MS Word 重新创建附加样式,以在我为朋友工作的 ePUB 中使用。我总是可以截取每个章节标题的屏幕截图并这样做,但我更喜欢在 CSS 中完成。
这是我在 Word 中得到的:
这是我到目前为止的代码:
@font-face {
font-family : "AR Christy";
font-style : normal;
font-weight : normal;
src : url("../fonts/archristy.ttf");
}
h1 {
font-family : "AR Christy", serif;
font-weight : bold;
font-style : normal;
font-size : 30pt;
text-decoration : none;
font-variant : normal;
color : #95B932;
-webkit-text-stroke-width: 1px;
-webkit-text-stroke-color: white;
-webkit-text-stroke: 1px white;
text-shadow: 2px 2px 2px #888888;
line-height : 1;
}
以下是在 Safari 中呈现时的外观:
如果有意义的话,我似乎对文本的“纹理”有疑问。
如果您有兴趣尝试提供帮助,可以在此处获得该字体:http: //fontzone.net/font-details/ar-christy
我添加了以下两张特写图片以使差异更加明显。这是Word版本:
这是当前的 CSS 版本:
编辑:感谢凯利的建议,我决定必须使用多个阴影层。这是我最终使用的代码:
text-shadow: rgb(187, 187, 187) 0px 1px 0px,
rgb(181, 181, 181) 0px 2px 0px,
rgb(172, 172, 172) 0px 3px 0px,
rgb(160, 160, 160) 0px 4px 0px,
rgb(145, 145, 145) 0px 5px 0px,
rgb(127, 127, 127) 0px 6px 0px,
rgba(0, 0, 0, 0.199219) 0px 7px 1px,
rgba(0, 0, 0, 0.296875) 0px 8px 6px;
看起来像这样......不完全匹配,但我喜欢整体感觉: