如何像数字时钟 CSS 一样设置字体系列?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33649957/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 11:34:52  来源:igfitidea点击:

How to set the font-family like a digital clock CSS?

css

提问by zgrizzly_7

I would like to use a font-family in CSS that the numbers and maybe letters looks like the one in a digital clock. Where can I find a font like this?

我想在 CSS 中使用字体系列,数字和字母看起来像数字时钟中的字体。我在哪里可以找到这样的字体?

回答by Collins Abitekaniza

Just do this

就这样做

@font-face{
 font-family:'digital-clock-font';
 src: url('put_the_location_to_your_font.ttf or .otf');
}

Then apply it to your text font-family:'digital-clock-font'

然后将其应用于您的文本 font-family:'digital-clock-font'

Use Googleto find a font you like, or try this link for digital clock fonts: http://www.1001fonts.com/digital+clock-fonts.html

使用Google查找您喜欢的字体,或尝试使用此链接获取数字时钟字体:http: //www.1001fonts.com/digital+clock-fonts.html

回答by Mike

<link href='https://fonts.googleapis.com/css?family=Orbitron' rel='stylesheet' type='text/css'>

then...

然后...

<div style="font-family: 'Orbitron', sans-serif;">12:04PM</div>

<link href='https://fonts.googleapis.com/css?family=Orbitron' rel='stylesheet' type='text/css'>

    <div style="font-family: 'Orbitron', sans-serif;">12:04PM</div>

回答by parth2701

You might want to take a look at DS Digital its a font that resembles a digital clock. But Im not too sure how you could use it in CSS.

您可能想看看 DS Digital,它是一种类似于数字时钟的字体。但我不太确定如何在 CSS 中使用它。