如何使用 JavaScript 创建小字体文本?

javascriptweb developmentfront end technology

要使用 JavaScript 创建小字体文本,请使用 small() 方法。此方法使字符串以小字体显示,就像在 <small> 标签中一样。

示例

您可以尝试运行以下代码以使用 JavaScript 创建小字体 −

<html>
   <head>
      <title>JavaScript String small() Method</title>
   </head>

   <body>
      <script>
         var str = new String("Demo Text");
         document.write(str.small())
         alert(str.small());
      </script>
   </body>
</html>

相关文章


有用资源