Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

How to set text alignment for OSweb

Hi everyone!

I'm currently building an online experiment using OSweb extension.

I've now encountered a problem where text I set in a JavaScript inline script is always aligned to the left in sketchpads and feedback items, whereas text written directly in the sketchpad or feedback item is by default centered (which I prefer). This only occurs when the experiment is run in browser. In the local OpenSesame client the programmatically set text is actually centered.


For reference:

I define the text in the inline script with:

var text_1 = "This is text_1";

vars.text = text_1;

And in the textline element in the sketchpad:

[text]


I've also tried to use the HTML code to set alignment, both in the script (as var text_1 = "<p style=text-align:center;>This is text_1</p>;") and in the textline element (as <p style=text-align:center;>[text]</p>), but it doens't make a difference.

Would any of you have an idea how to achieve center alignment for text set in JS inline script?

Comments

Sign In or Register to comment.