CSS & Javascript in deck descriptions?

TappedOut forum

Posted on March 12, 2017, 2:25 p.m. by Mr_Radical

I notice that neither css nor javascript have been working in my deck descriptions. In another thread, someone said that only upgraded users can use css. Does that apply to scripts as well? For css, people seem to be importing stylesheets, but what I have in mind involves the style tags (which is to say that I'm more used to using them), do both work? Also, a big concern with using css and scripts that people have is "breaking the site," is there anything in particular that will do this or do I just code normally and cross my fingers?

multimedia says... #2

You have to be an upgraded user to include both CSS and JavaScript in your deck description. Once you're upgraded you have two options for using CSS. You can use an external CSS stylesheet with the link HTML tag:

<link rel="stylesheet" type="text/css" media="screen" href="https://dl.dropbox.com/s/pathtocss/css.css?dl=0" />
Or you can use inline styles with the style attribute in HTML tags:
<p style="font-size:14px;padding-left:40px">Some text</p>
The style HTML tag containing CSS rules doesn't work; the page will not read the CSS:
<style>
h1 {color:red;}
p {color:blue;}
</style>

For JavaScript TappedOut is build with the Bootstrap HTML framework which includes the jQuery JavaScript library. You can use jQuery for all your JavaScript needs just include a script HTML tag at the bottom of your description which contains your scripts:

<script src="https://dl.dropbox.com/s/pathtojs/scripts.js?dl=0"></script>

I can help you if you have other questions.


March 13, 2017 6:27 a.m.

Mr_Radical says... #3

Righto, thanks multimedia

March 14, 2017 10:45 p.m.

Ghosty says... #4

is it possible to host my css files on github?

August 3, 2017 4:39 a.m.

Please login to comment