I have a text node attached to a div that I want to position in the middle of the page. These elements are attached to a mainDiv which is like the whole page. Here's the code I'm trying:
title = document.createElement('div');
title.appendChild(document.createTextNode(The big title!));
title.style.color = #F5AE20;
title.style.textAlign = center; //this is what I'm trying to solve my problem
mainDiv.appendChild(title);
Unfortunately the title stays on the top left of the page; I want it top centered.
EDIT - just to clarify, I would like to do this within Javascript if possible.
Thanks for any help.