J'ai essayé de trouver comment faire cela, au moins this link m'a presque obtenu. mais il utilise un lien pour changer la police.Comment faire pour modifier bootstrap.css font-family HTML à ma propre police téléchargée
mais j'ai ma propre police téléchargée à l'aide font converter (.eot .otf .svg .ttf .woff .woff2)
et j'ai style.css
comme ci-dessous:
/* font converted using font-converter.net. thank you! */
@font-face {
font-family: "CataneoBT-Regular";
src: url("./fonts/07323Cataneo.svg") format("svg"), /* Legacy iOS */
url("./fonts/07323Cataneo.ttf") format("truetype"), /* Safari, Android, iOS */
url("./fonts/07323Cataneo.woff") format("woff"), /* Modern Browsers */
url("./fonts/07323Cataneo.woff2") format("woff2"); /* Modern Browsers */
font-weight: normal;
font-style: normal;
}
C'est morceau de code de mon bootstrap.css html:
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
Le code le plus proche de mon bootstrap est:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix')
format('embedded-opentype'),
url('../fonts/glyphicons-halflings-regular.woff2')
format('woff2'),
url('../fonts/glyphicons-halflings-regular.woff')
format('woff'),
url('../fonts/glyphicons-halflings-regular.ttf')
format('truetype'),
url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular')
format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
mais pour autant que je sache, ce code juste pour afficher une icône
Je ne sais pas comment changer ce code pour afficher ma propre police
Utilisez-vous le code compilé ou le code source (LESS, SASS)? –
Vous n'avez pas vraiment besoin d'inclure tous ces formats de police. Woff est assez bon. http://caniuse.com/#feat=woff –