Need help with calling a JS event based on button presses and changing CSS font styling accordingly for each button? Check out the code snippet below:
body { background-image: url("back2.jpg"); background-size: 100% 100%; } .buttonSize1{ font-size: 3px; } .buttonsize2{ font-size: 26px; } .buttonsize3{ font-size: 45px; } /* Additional CSS styles */ .fixed { position: fixed; top: 100px; left: 0px; width: 150px; border: #0E6B5B 3px solid; background-color: #FF9933; } p { padding-left: 100px; } td { padding-top: 10px; padding-bottom: 50px; text-align: center; font-family: "Lucida Console", Monaco, monospace; } .opac { opacity: 0.5; filter: alpha(opacity=10); /* For IE8 and earlier */ } .opac:hover { opacity: 1.0; filter: alpha(opacity=100); /* For IE8 and earlier */ } .MainTable{ border: #0E6B5B 3px solid; background-color: #FF9933; width: 50%; padding-top: 10px; padding-left: 100px; padding-right: 100px; } table.center { width:70%; margin-left:15%; margin-right:15%; }
Head over to the HTML section where JavaScript functions are defined to change font size:
<!doctype html> <html> <head> <link rel="stylesheet" href="7Global.css"/> <title> CSGO </title> <script> function textSizeS(){ document.getElementById("Maintbl").style.font-size = "3px"; } function textSizeM(){ document.getElementById("Maintbl").style.font-size = "26px"; } function textSizeL(){ document.getElementById("Maintbl").style.font-size = "45px"; } </script> </head> ...