I have a CSS elements defined as below:
.myRedClass
{
background-color:red;
}
And it is assigned to many Divs( that are having similar appearance). At some point i need to assign some left-margin also. What i am currently doing is; I will add and remove a Predefined Class .redClass-margin{margin-left:10px}
to each of the required div. The code for this is:
$( "myDiv1" ).addClass( "redClass-margin" );
$( "myDiv2" ).addClass( "redClass-margin" );
$( "myDiv3" ).addClass( "redClass-margin" );
and so on... Instead for this Can i do changes in the existing css class. Is their any possibility to change the .myRedClass
like the following :
.myRedClass
{
background-color:red;
margin-left:10px;
}
Either Through script or through c#