I wrote 2 styles. And I will apply them often to single words. Tell me, please, is it possible in CSS to assign a name (possibly with parameters) to a sequence of commands already defined in CSS to call this sequence of commands by writing this name (possibly with parameters)?
- oneNothing is clear from the word at all - Dizzy221
- See it. I will bring analog from LaTeX. There is a command \ newcommand. They use it like this: suppose I wrote this: `` `\ newcommand {\ smb} [2] {\ left (\ frac {# 1} {# 2} \ right}}` `` This means I defined a new command \ smb, depending on two parameters (in the code it is indicated by part [2] ), the meaning of which is that it creates a fraction in the output pdf (in the \ frac code), in the numerator of which is parameter # 1, and in the denominator - parameter # 2 surrounded on the left (in the \ left ( ) code and on the right (in the \ right ( ) code with parentheses. Thus, the subsequent command \ smb {a + b) {c} generates - Grek79
- <script src = ' cdn.mathjax.org/mathjax/latest/… > <h2> $$ \ left (\ frac {a + b} {c} \ right) $$ </ h2> - Grek79
- <! - begin snippet: js hide: false console: true babel: false -> <! - language: lang-html -> <script src = ' cdn.mathjax.org/mathjax/latest/… > < h2> $$ \ left (\ frac {a + b} {c} \ right) $$ </ h2> <! - end snippet -> - Grek79
|
2 answers
There are no macros in CSS. If you want to make your job easier, use LESS or another preprocessor. And to turn a nice flat code into an engineering monster is not necessary.
And in your case, instead of a command, you need to apply css-classes or attributes to single words.
|
In the comments does not work, I will insert in the answer, although not by the rules, for which I apologize.
<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> <h2>$$\Bigl(\frac{a+b}{c}\Bigr)$$</h2> |