html - 如何将字体添加到类

标签 html css fonts webfonts

嘿,谁能告诉我如何向 HTML 类添加字体?我正在看一个教程,但跳过了那部分,我很困惑他到底做了什么。有一个包含不同元素的框类,他试图在跳过之前添加字体样式。

这是 HTML 和 CSS,不包括 <head><body>标签:

.body {
  Background-color: red;
}

.box {
  Width: 174px;
  Height: 250px;
  Background: yellow;
  Width: 25px Padding:20px;
}

.true {
  Background-color: brown;
}

.true2 {
  Background-color: green
}
<Div class="box true"> this is an example</Div>
<Div class="box true2> parenthesis</Div>

最佳答案

使用 font-family类中的样式:

例子:

body {
    font-family: Arial, sans-serif;
}

关于html - 如何将字体添加到类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51900620/

相关文章:

html - @font-face 自定义字体的问题

html - CSS 响应式 - Logo 下的线条

html - 中心菜单导航

jquery - 真正的基本视差滚动?

javascript - 消除首屏内容中阻止呈现的 JavaScript 和 CSS - Wordpress

html - 如何将我的页脚推到右栏菜单的下方

css - DOMPDF - 如何将 PDF 呈现为完全没有边距?

html - 背景不透明度扩展

css - Rmarkdown 字体大小和标题

google-chrome - Google I/O - Chrome (windows) 中的 Roboto Font(新版本)字体渲染问题