Class

This page introduces WSphynxJS class


Here, you are going to learn how to:


Declare a class

Class let you use the same code or declaration for several divs.

Class tag

Class do not have a specific name tag. The name tag is, in fact, the name of your class. You just have to begin it with "ws"+"re" and to write it in lower case:

<wsremyclass> </wsremyclass>

Position of class tag

Class tag have to be placed at the beginning of your code. You have to declare a classe before use it:

<wsremyclass> </wsremyclass> <wsdiv> Something else </wsdiv> ...

Use a class

Class may be use for everything: wsphynx css, js or event.

Call a class inside a div

To use a class inside a specific div, you just have to write the name of your class + ; . It should look like this:

<wsremycss> color: #F00; background-color:Tomato; </wsremycss> <wsremyjs> console.log ("OK"); </wsremyjs> <wsdiv> Consuetudo est optima legum interpres <wscss> wsremycss; </wscss> <wsscript> wsremyjs; </wsscript> </wsdiv>

NOTE: when you use a class inside a wsphynxjs tag, you have to declare a tag only to call your class. You may not call a class and make something else after in the same tag, for example.

Copyright 2019 SphynxTech