Posted by Neredbojias on 12/09/20 11:33
With neither quill nor qualm, delraydog@gmail.com quothed:
> I'm writing a reusable JavaScript library which needs to set certain
> styles in a document. The document may have an existing stylesheet
> definition either by a link or by an existing stylesheet declaration in
> the documents head section.
>
> How can I use JavaScript to append my own style sheet information to a
> possibly already existing stylesheet definition?
That's no problem. The latest style is the one honored. Add something
like the following to the <head> section:
<script type="text/javascript">
<!--
document.write('<style type="text\/css">\n#ct1 { width:95.2%; text-
align:justify; }\n<\/style>\n');
document.close;
//-->
</script>
PS: This example is from one of my pages, has been checked and works.
--
Neredbojias
Contrary to popular belief, it is believable.
Navigation:
[Reply to this message]
|