text-align in html for text

I can’t get the text to be aligned.

$item('#text13').html = "<span style=' text-align:center; color:"+itemData.textColor+"; font-size:16px; font-family:helvetica; font-weight:bold;'>"+itemData.shortName+"</span>";

Everything works fine, expect the align.

Hi,

Can you please send a URL to your site and specify the name of the page?

Best,
Sapir

I was able to figure it out, basically I can’t include text-aling withn span. so added it as an extra tag.

@carlosgalvarez could you post the line of code you ended up using? I’ve tried everything and can’t seem to get my text to center align.

Thanks to this post I got it to work by using the tag - see code below.

The Wix documentation on this is at best vague to the point of being misleading, or at worst, plain incorrect, and should be updated - judging by the posts on the forum a lot of people have struggled to figure this out.

$w("#statusBox").html = `<p class="p3"; style=text-align:center><span style=font-weight:bold>${'Resolved'}
<br>
<span style=font-size:40px>${'✅'}</span></span></p>`;