A possible way to add CSS classes in HTML


Paolo Lops
Hi David,in an html i want create a parameter  in a line like this <div id="slide-out" class='side-nav fixed light-blue-skin green ' >for the color attribute<div id="slide-out" class='side-nav fixed light-blue-skin XXX ' >how i can do?i have try with window.App.RootScope.XXX  but with no succescan you help me?

DecSoft

Hello Paolo,

I am not quite sure if can understand perfectly, but, one of the possible aproach can be the below one. Supose we have an container like this in an HTML control:

Then, in our app, we can establish the "ContainerClasses" variable in a way like this, for example:

And... the result is the expected, that is, the "ContainerClasses" CSS classes are applied to the HTML container.

Note that is also possible to establish some CSS classes "by default", in an container like that:

Then we can set the other CSS classes using the variable:

In both cases the "bg-danger" and "text-white" CSS classes are applied to the HTML container.



Paolo Lops

Hi David,

perfect it works!

DecSoft

Good Paolo. :)


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.