<style>
.myFont {
text-decoration: underline;
}
.myDefaultFont: {
font-family: monospace;
}
.myFontHigh {
font-weight: bold;
border: 1px solid black;
}
.myFontHigh span {
font-size: 150%;
}
</style>
// Define the id of your board in BOARDID
JXG.Options.text.cssDefaultStyle = '';
JXG.Options.text.highlightCssDefaultStyle = '';
JXG.Options.text.cssClass = 'myDefaultFont';
var board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-3, 3, 3, -3]
});
var txt = board.create('text', [0, 1, " <span id='par'>(</span> Hello world <span id='par'>)</span>"],
{
cssClass: 'myFont',
strokeColor: 'red',
highlightCssClass: 'myFontHigh',
fontSize: 20
});
var p = board.create('point', [0, 0], {
name: 'AiX'
});
This example is licensed under a
Creative Commons Attribution ShareAlike 4.0 International License.
Please note you have to mention
The Center of Mobile Learning with Digital Technology
in the credits.