<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>css font-variant</title> <style> /*参考:https://www.w3school.com.cn/cssref/pr_font_font-variant.asp 知识点: font-variant 属性设置小型大写字母的字体显示文本, 这意味着所有的小写字母均会被转换为大写, 但是所有使用小型大写字体的字母与其余文本相比,其字体尺寸更小。 值 描述 normal 默认值。浏览器会显示一个标准的字体。 small-caps 浏览器会显示小型大写字母的字体。 inherit 规定应该从父元素继承 font-variant 属性的值。 */ p.normal { font-variant: normal } p.small { font-variant: small-caps } </style> </head> <body> <p class="normal">This is a paragraph</p> <p class="small">This is a paragraph</p> </body> </html>