Is there anyway i can use javascript to center a div tag on a page? I'm using style sheets to position the tag on the screen right now but i want the contents of the tag centered regardless of the screen resolution. Any help is greatly appreciated.
Unfortunately if i use left:50% it moves the top left-hand corner of the div tag to the center of the page which means that all the contents of the div tag start at the center of the page and i want the center of the div's contents to be in the center of the page, in effect centering th div tag
>>i want the contents of the tag centered regardless of the screen resolution
What's the connection between content alignment and screen resolution?
use this in css:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.