Fandom

Community Central

Importing css

Forum page

19,031pages on
this wiki
Add New Page
Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

This Forum has been archived

Visit the new Forums
Forums: Index Support Requests Importing css
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 1598 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.



I just realized that the following line is incorrect

importScriptURI( 'http://religion.wikia.com/index.php?title=User:Granpa/wikia.css&action=raw&ctype=text/javascript' );

Even though the given url does indeed open to the right page it doesnt work presumably because type=text/javascript is incorrect.

what type should I use to make this work correctly?

I already tried the obvious.

Granpa (talk) 23:19, July 24, 2012 (UTC)


Here's a couple different imports you could use (these are JavaScript):

// strict, fails on syntax errors
importScriptURI( 'http://religion.wikia.com/index.php?title=User:Granpa/wikia.css&action=raw&ctype=text/css' );
 
OR
 
// lenient, doesn't care about syntax errors as much
importStylesheetPage('User:Granpa/wikia.css', 'religion');

Warning: The stylesheet you are trying to use has a number of syntax errors, of which the following may only be a few:

@media print {     /* << unclosed */
 
/* further down... */
 
td,
th,
html, 
article, 
span, 
div                /* << missing comma */
li,
pre,
dd,
a
 
/* further down... */
 
******************************************************************************** old versions commented out *******************************
 
/* ^ That's not a proper CSS comment */

20px_Rin_Tohsaka_Avatar.png Mathmagician ƒ(♫) 23:31 UTC, Tue, 24 July 2012


Thank you. I have a second account and I am trying to import it into this page
http://religion.wikia.com/wiki/User:Granpa2/wikia.css
I have tried both and neither works.
Now that I think about it, we were importing navigation popups into our sitewide javascript page using a very similar line and it stopped working many months ago.
Granpa2 (talk) 00:15, July 25, 2012 (UTC)


our javascript page is empty now but here is what it looked like before it mysteriously stopped working.
http://religion.wikia.com/wiki/MediaWiki:Wikia.js?oldid=190668
Granpa (talk) 00:19, July 25, 2012 (UTC)
I wouldn't know anything about why your navigation pop ups don't work. It appears to be a script from Wikipedia, and there's no guarantee that scripts from Wikipedia will work (or continue to work) here on Wikia, as both sites are quite different.
w:c:religion:User:Granpa2/wikia.css <-- You can't put JavaScript in a CSS page like that! The import statements I gave you above were JavaScript.
// One way to import
// http://religion.wikia.com/index.php?title=User:Granpa/wikia.css
 
// NOTE: This is JavaScript, so it has to go on a .js page
// (This is the same as the example I gave above)
 
importStylesheetPage('User:Granpa/wikia.css', 'religion');

/* Another way to import */
/* http://religion.wikia.com/index.php?title=User:Granpa/wikia.css */
 
/* NOTE: This is CSS, so it has to go on a .css page */
 
@import url("http://religion.wikia.com/index.php?title=User:Granpa/wikia.css&action=raw&ctype=text/css");
20px_Rin_Tohsaka_Avatar.png Mathmagician ƒ(♫) 00:34 UTC, Wed, 25 July 2012
Its working great. :-) Granpa2 (talk) 01:01, July 25, 2012 (UTC)

Also on Fandom

Random Wiki