- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
默认情况下,可以实现不同的字体、字体粗细和样式,以便稍后在我的 css 样式中使用:
@font-face {
font-family: "My Font Family";
src: url("fonts/my-font-family-regular.ttf");
font-weight: regular;
}
@font-face {
font-family: "My Font Family";
src: url("fonts/my-font-family-bold.ttf");
font-weight: bold;
}
现在我想添加一个 light
和一个 medium
版本:
@font-face {
font-family: "My Font Family";
src: url("fonts/my-font-family-light.ttf");
font-weight: 200;
}
@font-face {
font-family: "My Font Family";
src: url("fonts/my-font-family-medium.ttf");
font-weight: 500;
}
但这对我不起作用。是否有关于字体粗细值的约定?
最佳答案
编辑
如果您只需要一个font
名称,您可以使用class
es 设置一个字体集weight
@font-face {
font-family: "myFont";
src: url("fonts/my-font-family-light.ttf");
font-weight: 200;
}
.s1{
font-family: myFont;
font-weight: 200;
}
.s2{
font-family: myFont;
font-weight: 400;
}
.s3{
font-family: myFont;
font-weight: 600;
}
否则,为每个元素分配不同的名称
@font-face {
font-family: "myLightFont";
src: url("fonts/my-font-family-light.ttf");
font-weight: 200;
}
@font-face {
font-family: "myMediumFont";
src: url("fonts/my-font-family-medium.ttf");
font-weight: 500;
}
检查 w3schools了解更多信息
关于html - 每个字体系列超过 2 个字体粗细?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39275536/
我有一个格式良好的单元格范围,具有不同的边框线粗细(其中一些是中等厚度,其中一些是薄的,没有特定的图案)。我想运行一个将边框颜色更改为灰色的宏,但每次执行此操作时,它都会自动将所有边框粗细更改为 xl
我可以使用百分比使我的图像/div 具有响应性。 如何使字体大小响应不同的屏幕大小? 最佳答案 我最近偶然发现了这个问题,并为此编写了一个适合我需要的解决方案。也许您会发现您也可以将它合并到您的 CS
在 iOS 8 中,为了获得 Helvetica Neue 的细变体,以下代码可以工作 UIFont.systemFontOfSize(50, weight: UIFontWeightThin) 在
我想将 matplotlib 绘图中使用的默认字体更改为 Windows 下的 Segoe UI。我可以通过像这样改变 rcParams 来做到这一点 import matplotlib matplo
我想知道是否有人知道基于 Bresenham 的线算法或任何类似算法绘制具有特定粗细的线的任何算法。 再想一想,我一直在想,对于每个 setPixel(x,y) 我只是画一个圆圈,例如: filled
我正在尝试自定义我已经拥有的用于选择 Google 字体和更新预览 DIV 的功能之一,但是我还想添加“字体大小”、“字体粗细”、“字母间距”等,但是此功能仅在您单击“主字体选择器”组合框时才有效,我
我正在使用 RaphaelJS 在 IE8 中调试一些性能问题。我们正在 raphael 中从大约 1000 个元素和文本节点构建图形,特别是一个图形在渲染时给我们带来了问题。在 IE9 中,根据机器
我是一名优秀的程序员,十分优秀!