如何更改现有脚本中的字体颜色? [英] How to change font color inside an existing script?
本文介绍了如何更改现有脚本中的字体颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从一个网站获得一个脚本,将它放入我的网站,但字体颜色不是我想要的。
I get a script from a website to put it into my website, but the font color is not what I want.
脚本是:
<script language="javascript" src="http://www.parstools.net/calendar/?type=2"></script>
现在我想改变它的字体颜色。我该怎么办?
and now I want to change the font color of it. What should I do?
我非常感谢您的帮助,谢谢。
I would really appreciate your help, thanks.
推荐答案
该脚本的源,它只是写一个锚点链接与 document.write()
:
Examining the source of that script, it is simply writing an anchor link with document.write()
:
document.write("<a href='http://www.ParsTools.com/'>1389/1/31</a>");
您可能希望将该脚本包含在< div& code>,然后使用CSS在
< div>
中为锚链接设置样式:
You may want to include that script inside a <div>
, and then style the anchor links within that <div>
using CSS:
<div id="calendar">
<script src="http://www.parstools.net/calendar/?type=2"></script>
</div>
然后您还应该添加以下CSS类定义:
Then you should also add the following CSS class definition:
div#calendar a {
color: red;
}
以下是一个完整的示例:
The following is a full example:
<!DOCTYPE html>
<html>
<head>
<title>Simple Demo</title>
<style type="text/css">
div#calendar a {
color: red;
}
</style>
</head>
<body>
<div id="calendar">
<script src="http://www.parstools.net/calendar/?type=2"></script>
</div>
</body>
</html>
这篇关于如何更改现有脚本中的字体颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文