JavaScript big() 方法

String 对象参考手册 JavaScript String 对象

定义和用法

big() 方法用于把字符串显示为大号字体。

该方法返回加了 <big> 标签的字符串, 如下所示:

<big>string</big>

语法

string.big()

浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要浏览器都支持 big() 方法。


实例

用大号字体显示字符串:

<script>
  var txt = "Hello World!";
  document.write("<p>字体变大: " + txt.big() + "</p>");
  document.write("<p>字体缩小: " + txt.small() + "</p>");
  document.write("<p>字体加粗: " + txt.bold() + "</p>");
  document.write("<p>斜体: " + txt.italics() + "</p>");
  document.write("<p>固定定位: " + txt.fixed() + "</p>");
  document.write("<p>加删除线: " + txt.strike() + "</p>");
  document.write("<p>字体颜色: " + txt.fontcolor("green") + "</p>");
  document.write("<p>字体大小: " + txt.fontsize(6) + "</p>");
  document.write("<p>下标: " + txt.sub() + "</p>");
  document.write("<p>上标: " + txt.sup() + "</p>");
  document.write("<p>链接: " + txt.link("https://www.mifengjc.com") + "</p>");
  document.write("<p>闪动文本: " + txt.blink() + " (不能用于IE,Chrome,或者Safari)</p>");
</script>

尝试一下 »


String 对象参考手册 JavaScript String 对象