Css 字体混乱粗体指令(引导所见即所得)

Css 字体混乱粗体指令(引导所见即所得),css,twitter-bootstrap,font-face,bootstrap-wysiwyg,Css,Twitter Bootstrap,Font Face,Bootstrap Wysiwyg,我在popover中使用bootstrap wysiwyg。(只有粗体字才起作用)。现在,如您所见-按Ctrl+B将文本设置为粗体,再次按将使其恢复正常 该演示运行良好,但在我自己的项目中,我使用的是本地字体,即: @font-face { font-family: BerninaSans; src: url('theme/BerninaSans/normal/berninasans-condensedregular-webfont.eot'); src: url('th

我在popover中使用bootstrap wysiwyg。(只有粗体字才起作用)。现在,如您所见-按Ctrl+B将文本设置为粗体,再次按将使其恢复正常

该演示运行良好,但在我自己的项目中,我使用的是本地字体,即:

@font-face {
    font-family: BerninaSans;
    src: url('theme/BerninaSans/normal/berninasans-condensedregular-webfont.eot');
    src: url('theme/BerninaSans/normal/berninasans-condensedregular-webfont.eot?#iefix') format('embedded-opentype'),
         url('theme/BerninaSans/normal/berninasans-condensedregular-webfont.woff') format('woff'),
         url('theme/BerninaSans/normal/berninasans-condensedregular-webfont.ttf') format('truetype'),
         url('theme/BerninaSans/normal/berninasans-condensedregular-webfont.svg#bernina_sanscondensed_regular') format('svg');
    font-weight: normal;
    font-style: normal;
}


@font-face {
    font-family: BerninaSansBold;
    src: url('theme/BerninaSans/bold/berninasans-condensedbold-webfont.eot');
    src: url('theme/BerninaSans/bold/berninasans-condensedbold-webfont.eot?#iefix') format('embedded-opentype'),
         url('theme/BerninaSans/bold/berninasans-condensedbold-webfont.woff') format('woff'),
         url('theme/BerninaSans/bold/berninasans-condensedbold-webfont.ttf') format('truetype'),
         url('theme/BerninaSans/bold/berninasans-condensedbold-webfont.svg#bernina_sanscondensed_bold') format('svg');
    font-weight: bold;
    font-style: normal;
}
这不知怎么搞砸了一切——我可以单击Ctrl+B(或直接单击按钮)将文本加粗,但再次单击不会使其恢复正常。它只是保持大胆。按钮本身的行为也很奇怪,变为蓝色,但当你按下任何其他键时,按钮就会变回正常状态。我认为将第二个字体的
字体大小设置为
粗体
可以解决这个问题,因为它不能解决这个问题


我不知道如何设置这个演示来重现这个问题(是否有像…字体cdn之类的东西?),希望有人从类似的经验中知道答案,或者会给出一个有用的建议

结果是我应该给他们取相同的名字

根据,为字体定义粗体版本的正确方法是使用相同的字体系列名称,但具有不同的属性。这样,您的浏览器就知道其中一个是另一个的粗体版本

@font-face {
    font-family: BerninaSans;
    src: url('...');
    font-weight: normal;
    font-style: normal;
}


@font-face {
    font-family: BerninaSans; // <----
    src: url('...');
    font-weight: bold;
    font-style: normal;
}
@font-face{
字体系列:BerninaSans;
src:url(“…”);
字体大小:正常;
字体风格:普通;
}
@字体{

字体系列:BerninaSans;//我还使用了另外3种BerninaSans字体-半粗体版本(
font-style:normal;
)、超粗体版本(
font-style:bold;
)和浅色版本(也是
normal
).我怀疑这是否相关,但仍然…而且,问题只出现在
bold
指令中(下划线和斜体工作正常)