

In the example below, the stimulus font size is set to 30px and the text color is set to red. To change an element's style using inline CSS, you can set the element's "style" attribute to a string that contains the CSS parameters that you want to change, along with the values that you want to use.
CANVAS MOUSE COORDINATES TEXT ALIGN TRIAL
This is a good option for when you want to make few and/or simple style changes to an HTML trial parameter. Inline CSS is a way of adding style and formatting directly into a specific HTML element using its "style" attribute. Whenever you're using a parameter that accepts an HTML-formatted string, you have the option to include inline CSS.

You can also see this page about adding CSS to web pages to learn more. This section discusses the different ways of incorporating CSS into your jsPsych experiment.

It might also depend on whether you want the style/formatting change(s) to apply to specific trials, to the whole experiment (HTML page), or across different experiments. The method that you choose is partly a matter of personal preference. There are a few ways to change the style and formatting in your experiment. Your experiment's style and formatting comes from the CSS (cascading style sheet) rules that are stored in the jspsych.css file, and the browser's defaults. Demo Experiment: Simple Reaction Time Taskĭata Storage, Aggregation, and ManipulationĮxclude Participants Based on Browser Features
