Forum:Add custom CSS to a page

Hello folks,

i'm in the situation that i don't have access to the MediaWiki:Wikia.css, but need to add a few css classes to style some content. Is there any way that i can add css to a page without using the MediaWiki:Wikia.css?

ArtisticMink (talk) 07:28, December 10, 2012 (UTC)


 * No. Without access to the site CSS, you can only use . If you are on a Wiki where you are not an admin but want to do something like add custom CSS styles to your user page then you could ask an admin to write a JavaScript that will load CSS out of an invisible DIV on user pages only. Personally I don't like that sort of thing as it allows malicious users to mess up the site UI and break ToU by hiding ads and so on, but it's up to individual communities if they want to deal with the administration overhead of this. If you just want to create styles for article/project pages then you may as well just ask one of the admins to add the styles to the global files for you. Lunarity 08:00, December 10, 2012 (UTC)


 * Thanks fo the fast answer. Sadly, the admin seems to be on vacation or busy. However, i was afraid that wikia would not parse the style attribute in div tags. I will give it a try. Have a nice day.


 * ArtisticMink (talk) 08:17, December 10, 2012 (UTC)


 * MediaWiki will accept any and all attributes on raw HTML tags, only which HTML tags you can use are restricted (You can use P, H2, DIV, SPAN, etc. but not STYLE, SCRIPT, IMG, A, BUTTON, FORM, INPUT, ...). That said, references to external resources are blocked. You cannot use  in inline styles (so   will only work with gradients, not images), you must use global CSS files for background images [You can hack around this using normal wiki images inside a DIV with z-index and position:absolute tricks though]. Lunarity 08:58, December 10, 2012 (UTC)


 * P.S. If the wiki's admins have all been inactive for 60 days then you can apply to Wikia to adopt the wiki. Lunarity 09:00, December 10, 2012 (UTC)