0

I have this DOM class which I add to a jqMath expression to change the color of part of an equation which I've written using jqmath and the corresponding CSS:

.myclass {
  color: blue;
}

The thing is the color usually changes as expected but this is not the case if I have for example a division in the equation like this: $d/\dx[x^2]$. In this case the color isn't applied to the division (neither to numerator nor to denominator). As far as I know to add a class in jqmath I have to use this \cl "myclass" command.

Edit: This is my css:

#myid {
  align-text: left;
}
.myclass {
  color: blue;
}
.myclass:active {
  font-weight: bold;
}

and html:

<body>
  <div>
    <p id='myid' >$\cl 'myclass' {d/\dx[x]}$</p>
    <br>
  </div>
</body>
YakovL
  • 7,557
  • 12
  • 62
  • 102
has19
  • 1,307
  • 16
  • 31

2 Answers2

1

Use $\cl"myclass" {d/\dx [x^2]}$, i.e. put {} around the expression to group it into a single item.

You might like $\cl"myclass" {d/{\it \dx} [x^2]}$ even better (I think it looks more standard).

Dave Barton
  • 1,429
  • 13
  • 12
  • from this example $\cl "myclass" {d/\dx [x^2]}$ the color change apply only to [x^2] while the division and anything above it or below it(numerator or denominator) don't change which is my problem – has19 Apr 20 '16 at 17:27
  • Do you have a test page or fiddle for this that I could view? I think you must have some other style rules with higher specificity or something, because the whole expression changed color for me. – Dave Barton Apr 22 '16 at 17:20
  • i added the css and html ,i am testing it on android webview. anyway it works fine if i added a star next to the class in the css – has19 Apr 23 '16 at 12:20
1

just in case anybody have the same problem i solved it by adding a * next to the class in css

.myclass *{
color:blue ;
}
has19
  • 1,307
  • 16
  • 31
  • Since this solved your issue, you should accept your own answer: this will indicate that this is actually a solution. – YakovL May 31 '16 at 11:04