Modifying a SnapPages theme, meaning I only have access to the CSS stylesheet. I would like to insert some javascript in the header of the site in order to use TypeKit for styling typography. Is there anyway to do that from CSS?
A:
Simple answer: No.
More complex answer: CSS doesn't have the ability to make any changes to your page and things included in a page either via:
<link rel="stylesheet" type="text/css" href="custom.css" />
// or
<style>
..
</style>
Can't be made to execute as script.
Erik
2010-03-12 22:56:46
+1
A:
Though you can in a sense alter (some of) the contents of a page from CSS, its use is discouraged and it is not up to the task you want to handle.
From quir]{smode: "I feel that we shouldn't use the content declaration at all. It adds content to the page, and CSS is meant for adding presentation to the page, and not content. Therefore I feel that you should use JavaScript if you want to dynamically generate content. CSS is the wrong tool for this job."
andras
2010-03-12 23:19:19