设置页面文字大小及颜色

在<head></head>中加入以下的脚本代码:

<SCRIPT>
            
function fontZoom(size)
            
{
                document.getElementById('content').style.fontSize
=size+'px'
            }

            
function fontColor(color)
            
{
                document.getElementById('content').style.color
=color
            }

 
</SCRIPT>

在<body></body>合适位置加入以下代码:
<TABLE width="100%" border="0" align="center" cellPadding="0" cellSpacing="0" >
                    
<TBODY>
                        
<TR>
                            
<TD align="right">&nbsp; 【字体:<href="javascript:fontZoom(16)"></A>&nbsp;<href="javascript:fontZoom(14)"></A>&nbsp;<href="javascript:fontZoom(12)"></A>】【颜色:<href="javascript:fontColor('#ff0000')"><FONT color="red"></FONT></A>
                                
<href="javascript:fontColor('#007700')"><FONT color="#007700">绿</FONT></A> <href="javascript:fontColor('#003399')">
                                    
<FONT color="#003399"></FONT></A> <href="javascript:fontColor('#000000')"><FONT color="black">
                                        黑
</FONT></A></TD>
                            
<TD align="right" width="20"></TD>
                        
</TR>
                    
</TBODY>
                
</TABLE>

posted on 2007-07-19 17:16    阅读(766)  评论(0编辑  收藏  举报

导航