如何把css代码写入js文件

来源:百度知道 编辑:UC知道 时间:2024/09/21 04:39:29
我做网页需要一个js特效,一下是代码:
<html>
<head>
<title>页面特效--屏幕式左右拉开</title>
<style type="text/css">
A:link {text-decoration: none; color:#000000}
A:visited {text-decoration: none; color: #000000}
A:active {text-decoration: none; color: #FF0000}
A:hover {text-decoration: underline; color: FF0000}
body{font-size=9pt}
TH{FONT-SIZE: 9pt}
TD{ FONT-SIZE: 9pt}
.intro{
position:absolute;
left:0;
top:0;
layer-background-color:#9999ff;
background-color:#9999ff;
border:0.1px solid red
}
</style>
</head>
<body bgcolor="#cc99cc">
<div id="i1" class="intro"></div><div id="i2" class="intro"></div>
<script language="JavaScript">
var speed=20 //改变拉开速度,数值大速度快。
var temp=new Array

把<style type="text/css"></style>里的CSS样式放入一个文件里,JavaScript里的内容放入另外一个JS文件里,然后在<head></head>中调入这两个文件

好像JS里不能写CSS代码吧不懂这个,来凑个热闹吧,我也想知道