【问题标题】:Icons are cutted off in Chrome (only on OSX)Chrome 中的图标被截断(仅在 OSX 上)
【发布时间】:2015-04-04 06:32:04
【问题描述】:

我在 Google Chrome 中的自定义图标字体有问题,仅在 Mac 上。它们在边缘被切断。我已经试过了

  • 使用更大的 svg 和
  • 更喜欢 SVG(在 woff 之前)
  • 使用 CSS 设置

你可以在 kuyichi.com 上看到它(如果你有 Chrome 和 OSX) 图标没有边框,四舍五入是图标本身。

有没有人可以解决这个问题?

实时取景: http://i.stack.imgur.com/niqcP.png

icomoon 上的图标包: http://i.stack.imgur.com/PwyCm.png

@font-face {
	font-family: 'iconfont';
	src:url('fonts/iconfont.eot?nr90fm');
	src:url('fonts/iconfont.eot?#iefixnr90fm') format('embedded-opentype'),
		url('fonts/iconfont.woff?nr90fm') format('woff'),
		url('fonts/iconfont.ttf?nr90fm') format('truetype'),
		url('fonts/iconfont.svg?nr90fm#iconfont') format('svg');
	font-weight: normal;
	font-style: normal;
}

[class^="icons-"], [class*=" icons-"] {
	font-family: 'iconfont';
	speak: none;
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	line-height: 1;

	/* Better Font Rendering =========== */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.icons-knit:before {
	content: "\e628";
}

【问题讨论】:

  • 向我们展示相关的 HTML 和 CSS——没有它我们什么都做不了。将其放入jsFiddle 也会有所帮助。

标签: html css macos google-chrome icon-fonts


【解决方案1】:

尝试将尺寸信息添加到您的图标声明中:

.icons-knit:before {
    content: "\e628";
    width:40px;
    height:40px;
    font-size:20px;
}

【讨论】:

    猜你喜欢
    • 2016-06-02
    • 1970-01-01
    • 1970-01-01
    • 2011-09-07
    • 1970-01-01
    • 2016-09-16
    • 2015-11-21
    • 2013-10-10
    • 2017-06-15
    相关资源
    最近更新 更多