Using CSS styles: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 1: Line 1:
<html>
<html>
<style type="text/css">
<style type="text/css">
.myfont {
.myFont {
     font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
     font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
     border: 1px solid black;
     border: 1px solid black;
     padding: 5px;
     padding: 5px;
     border-radius:5px;
     border-radius:5px;
    color: red;
}
}
.myFontHigh {
    font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
    border: 1px solid black;
    padding: 5px;
    border-radius:5px;
    font-size:150%;
}


.mySerifFont {
.mySerifFont {
Line 18: Line 26:
var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-5,5,5,-5]});
var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-5,5,5,-5]});


var txt = board.create('text', [1,2, "Hello world"], {cssClass:'myfont'});
var txt = board.create('text', [1,2, "Hello world"],  
          {
            cssClass:'myFont', strokeColor:'red',
            highlightCssClass: 'myFontHigh'
          });


</jsxgraph>
</jsxgraph>

Revision as of 09:05, 10 October 2012

The JavaScript code