[英]How to change font-family to Lato in tailwind css?
How to change font-family to Lato in tailwind css in my navbar?如何在我的导航栏中将字体系列更改为顺风 css 中的 Lato? i tried to do something like font-family-lato but it didint work out can anyone can tell how to change it in my navbar text?
我尝试做一些类似 font-family-lato 的事情,但它没有成功任何人都可以告诉我如何在我的导航栏文本中更改它吗?
<nav class="bg--800 text-white py-4 flex items-center justify-between font-lato">
<a href="#" class="font-bold text-xl">Logo</a>
<ul class="flex">
<li class="mr-6">
<a href="#" class="text-base hover:text-orange-500">Home</a>
</li>
<li class="mr-6">
<a href="#" class="text-base hover:text-orange-500">About</a>
</li>
<li class="mr-6">
<a href="#" class="text-base hover:text-orange-500">Contact</a>
</li>
</ul>
</nav>
in tailwind configuration file:在顺风配置文件中:
fontFamily: {
'Lato': ['Lato', 'sans-serif'],
},
Don't forget to import the font in your CSS file.不要忘记在 CSS 文件中导入字体。
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
html {
font-family: Proxima Nova, system-ui, sans-serif;
}
}
module.exports = {
theme: {
fontFamily: {
'sans': ['ui-sans-serif', 'system-ui', ...],
'serif': ['ui-serif', 'Georgia', ...],
'mono': ['ui-monospace', 'SFMono-Regular', ...],
'display': ['Oswald', ...],
'body': ['"Open Sans"', ...],
}
}
}
<div class="font-body"> Open Sans font </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.