我想让我的页面使用文本输入动画,所以我找到了下面的代码。问题是我不知道如何将html字体放入其中,例如
<span style="color:#a52a2a;"><strong>HTML TEXT</strong></span>
那我该怎么做?提前致谢
<html>
<head>
<style type="text/css">
#myTypingText {
width: 700px;
height: 120px;
padding: 12px;
color: #800000;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
line-height: 1.5em;
}
</style>
</head>
<body>
<div id="myTypingText"></div>
<script>
var myString = "Place your string data here, and as much as you like.";
var myArray = myString.split("");
var loopTimer;
function frameLooper() {
if (myArray.length > 0) {
document.getElementById("myTypingText").innerHTML += myArray.shift();
} else {
clearTimeout(loopTimer);
return false;
}
loopTimer = setTimeout('frameLooper()', 70);
}
frameLooper();
</script>
</body>
</html>
&#13;
答案 0 :(得分:0)
您可以在CSS中设置font-weight。
#myTypingText {
font-weight:bold;
width:700px;
height:120px;
padding:12px;
color:#800000;
font-family:Arial, Helvetica, sans-serif;
font-size:16px;
line-height:1.5em;
}