使用JavaScript的fixed()方法以固定間距字體顯示,就像在標(biāo)簽中一樣。
示例
您可以嘗試運行以下命令以固定間距字體顯示字符串的代碼。
<html>
<head>
<title>JavaScript String fixed() Method</title>
</head>
<body>
<script>
var str = new String("Hello world");
alert(str.fixed());
</script>
</body>
</html>
登錄后復(fù)制
以上就是如何在等寬字體中顯示字符串?的詳細內(nèi)容,更多請關(guān)注www.92cms.cn其它相關(guān)文章!






