注册 登录
编程论坛 JavaScript论坛

请教一个简单问题

紫藤x 发布于 2012-04-23 13:07, 461 次点击
字体的样式(黑体,隶书,楷体),显示不出来,怎么修改
<script language="javascript">
 <!--
function ShowTitle(){
    document.write("<font style='font-size:24pt;align:center;'>"+"计算机与信息管理系"+"<p><br/>");
}
"<font style='font-family:黑体'>"+ShowTitle();
"<font style='font-family:隶书'>"+ShowTitle();
"<font style='font-family:楷体'>"+ShowTitle();
 //-->
   </script>
1 回复
#2
aspic2012-04-24 14:59
程序代码:
<script type="text/javascript">
function showTitle(){
    return "<font style='font-size:24pt;align:center;'>"+"计算机与信息管理系"+"<p>";
}
document.write("<font style='font-family:黑体'>" + showTitle() + "</font><br/>");
document.write("<font style='font-family:隶书'>" + showTitle() + "</font><br/>");
document.write("<font style='font-family:楷体'>" + showTitle() + "</font><br/>");
</script>

不知道你说的是不是这样
1