FrenkyB FrenkyB - 1 year ago 75
CSS Question

How to add class to <style></style>

I would like to add css class inside a view and later call it.

Something like this:

<style>
MarkSelectedRow {
background-color: cornflowerblue;
}
</style>


I was trying to call that class:

var MarkSelected = function (element) {

var tdCaller = $(element);
tdCaller.addClass("MarkSelectedRow");

}


But, nothing happens. It seems like class is not defined. Is it possible to define class inside
<style></style>
and later use it in code?

Answer Source

You miss the dot

<style>
   .class_name {
      background-color: cornflowerblue;
    }
</style>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download