热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

@font-face和-webkit-transform:rotate,不起作用-@font-faceand-webkit-transform:rotate,doesn'twork

ImmakingawebsitewithHTML5andCSS3features.Ivegottwocustomfontswhichareaddedthrough

I'm making a website with HTML5 and CSS3 features. I've got two custom fonts which are added through @font-face. They're used in logo. They're in 'h1' tags, and I rotated them with CSS3 proporety:

我正在建立一个HTML5和CSS3功能的网站。我有两个通过@ font-face添加的自定义字体。它们用于徽标。它们是'h1'标签,我用CSS3 proporety旋转它们:

transform: rotate(350deg);

Of course for every browser I used proper prefix (for IE: "-ms-", for FF: "-moz-", for Chrome/Safari: "-webkit-" and for Opera: "-o-"). The problem is that it doesn't rotate in Chrome and Safari. So my question is, does Webkit engine allow to rotate custom fonts with CSS3 properties?

当然对于每个浏览器我使用了正确的前缀(对于IE:“ - ms-”,对于FF:“ - moz-”,对于Chrome / Safari:“ - webkit-”和对于Opera:“ - o - ”)。问题是它不能在Chrome和Safari中旋转。所以我的问题是,Webkit引擎是否允许使用CSS3属性旋转自定义字体?

1 个解决方案

#1


12  

Most inline content doesn't support transforms in webkit browsers - this is a known limitation. Although H1 is a block level tag, my guess is that you're using a span tag (inline) inside the H1 tag around your actual text to add the font, and this is giving you problems.

大多数内联内容不支持webkit浏览器中的转换 - 这是一个已知的限制。虽然H1是一个块级标签,但我的猜测是你在实际文本周围的H1标签内使用了一个span标签(内联)来添加字体,这给你带来了麻烦。

Add "display: inline-block" and see if that helps.

添加“display:inline-block”,看看是否有帮助。


推荐阅读
author-avatar
so直接离我远点儿
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有