I am attempting to create an overlay for a couple of my divs to prevent users from progressing without completing previous tasks. The overlay is functioning correctly and the message is displaying, but I encounter issues when trying to center the message.
Here is my jQuery code:
$("<div>You must finish your previous tasks before moving on.</div>").css({
position: "absolute",
width: "100%",
height: "100%",
top: 0,
left: 0,
background: "rgba(0,0,0,0.3)"
}).appendTo($(".disabled-box").css("position", "relative"));
As soon as I add
text-align: "center"
it causes an error:
SyntaxError: Unexpected token '-'
Do you have any insights into why this might be happening?