Frage

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.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top