javascript 控制超级链接的样式代码 时间:2020-05-12 人气:0 超级链接 <script language=javascript> linkColor="#ff0000"; linkFontSize="18px"; linkFontWeight="normal"; linkTextDecoration="none"; vlinkColor="#ff0000"; vlinkFontSize="18px"; vlinkFontWeight="normal"; vlinkTextDecoration="none"; alinkColor="#3c5a9a"; alinkFontSize="20px"; alinkFontWeight="bold"; alinkTextDecoration="underline"; var linkStyle=document.createStyleSheet(); linkStyle.cssText="A:link{COLOR: "+linkColor + "; FONT-SIZE:" + linkFontSize + ";FONT-WEIGHT:" + linkFontWeight + ";TEXT-DECORATION:" + linkTextDecoration+";}" + "A:visited{COLOR: "+vlinkColor + "; FONT-SIZE:" + vlinkFontSize + ";FONT-WEIGHT:" + vlinkFontWeight + ";TEXT-DECORATION:" + vlinkTextDecoration+";}" + "A:hover{COLOR: "+alinkColor + "; FONT-SIZE:" + alinkFontSize + ";FONT-WEIGHT:" + alinkFontWeight + ";TEXT-DECORATION:" + alinkTextDecoration+";}" </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容