Hi, I'm trying to figure out how to center a <div> element in the exact center of the screen using CSS without aligning the text too, and I can't figure it out.
I've looked at the w3schools reference, and spent about an hour Googling, and couldn't figure it out.
Can anyone help?
Now if you are talking about centering it horizontally and vertically then that is another matter, just let me know and i can post an example that will work for that.Code:body { text-align: center; //needed for Internet explorer } .myDiv { width: 500px; margin: 0 auto; text-align: left; }
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks