RicardoRix wrote: ↑22 March 2024, 14:31 https://developer.mozilla.org/en-US/doc ... S/position
yes absolute or relative position should do the trick.
The browser F12 developer has an inspect element function and is great for dabbling with css and styling requirements. As well as seeing how your dojo.place functions worked.
Don't forget to a do a hard page reset (Cntrl-F5) after any css changes.
I tried that and unfortunately it did not work. With this:LeSteffen wrote: ↑22 March 2024, 09:35 For top and left to work, the element should also havedefined inside the CSS classCode: Select all
position: absolute
Code: Select all
var jstpl_token='<div style="position: absolute; top: ${t}px; left: ${l}px;" class="token tokencolor_${color}" id="token_${x_y}">${text}</div>';
dojo.place( this.format_block( 'jstpl_token', {
x_y: x+'_'+y,
color: this.gamedatas.players[ player ].color,
t: 10,
l: 80,
text: 123,
} ) , 'tokens' );
I was able to position it correctly using this:
Code: Select all
var jstpl_token='<div style="position: absolute; text-align: center; line-height: 60px; top: ${t}px; left: ${l}px;" class="token tokencolor_${color}" id="token_${x_y}">${text}</div>';