如何在CSS中获取浏览器的默认字体系列? [英] How to get the browser's default font family in CSS?

查看:139
本文介绍了如何在CSS中获取浏览器的默认字体系列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的CSS,也许这个问题很简单,但我搜索了一些,但没有找到我要找的东西。



我已经为我的所有网站声明了一个字体家族。现在,我想覆盖某些部分的字体系列。我需要浏览器的默认字体系列。如何在css中指定浏览器的默认字体系列?

  .browser-defatults {
font-family: ?????
}

也许我需要忽略所有样式,我怎么能这样做?

解决方案

据我所知,CSS没有为属性忽略所有以前的用户样式提供一个选项。

解决问题的方法可能是使用 generic font-family

  font-family :serif; 

并让浏览器选择。


I'm new to CSS and maybe this question is trivial, but I have googled a little and I didn't find what I'm looking for.

I have declared a font-family for all my site. Now, I want to override the font family for some sections. I need the browser's default font family. How can I specify the browser's default font family in a css?

.browser-defatults {
   font-family: ?????
}

Maybe I need to ignore all styles, how could I do this?

解决方案

From what I know CSS doesn't offer an option to ignore all previous user styles for a property.

A work-around to your problem may be to use a generic font-family,

font-family: serif;

and let the browser choose.

这篇关于如何在CSS中获取浏览器的默认字体系列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆