문제

I did something like this

@font-face{
  font-family:"MYFONT" !important;
  src: url("/assets/MYFONT.otf") format("opentype") !important;
}

And then I added

*{
  font-family:"MYFONT", sans !important;
}

It obliterated the glyphicons from Bootstrap.

How do I globally declare my font and yet keep the bootstrap glyphicon from being destroyed throughout my site?

Thanks.

도움이 되었습니까?

해결책

The problem is *, because it sets the font-family for all elements.

The quick fix is to do it like this: body { font-family:"MYFONT", sans; }

The correct fix is to use the LESS/SASS version of bootstrap and change the variable @font-family-sans-serif to use your custom font.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top