How to change font color inside an existing script?

I get a script from a website to place it on my website, but the font color is not what I want.

script:

<script language="javascript" src="http://www.parstools.net/calendar/?type=2"></script> 

and now I want to change its color. What should I do?

I am very grateful for your help, thank you.

+4
source share
2 answers

Studying the source of this script, he simply writes the binding with document.write() :

 document.write("<a href='http://www.ParsTools.com/'>1389/1/31</a>"); 

You might want to include this script inside a <div> , and then wire the binding in that <div> using CSS:

 <div id="calendar"> <script src="http://www.parstools.net/calendar/?type=2"></script> </div> 

Then you should also add the following CSS class definition:

 div#calendar a { color: red; } 

The following is a complete 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> 
+4
source

Suppose you want to change the font color of the HTML generated by the script? If so, just use plain CSS in your external stylesheet and it will apply to the added content.

For example, if you want to make the text inside the myElement element a beautiful blue color:

 #myElement { font-color: #0099FF; } 

If the script is not your own, you need to analyze the resulting code to determine which elements you need to style in order to change the color of the text. Many of the external scripts that you embed on your site contain built-in CSS rules, which means that you will have to redefine many elements in your external CSS stylesheet to change simple things like text color. You may also need to add !important to the end of your CSS rule to override the inline style:

 #myElement { font-color: #0099FF !important; } 
0
source

Source: https://habr.com/ru/post/1307411/


All Articles