Closed Thread
Results 1 to 2 of 2

Thread: CSS Problems, and I can't figure it out

  1. #1
    Join Date
    Jan 2010
    Location
    Meridian, MS.
    Posts
    16
    Rep Power
    0

    CSS Problems, and I can't figure it out

    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?

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Feral is offline Programmer
    Join Date
    Jul 2008
    Posts
    163
    Rep Power
    15

    Re: CSS Problems, and I can't figure it out

    Code:
    body {
    text-align: center; //needed for Internet explorer
    }
    
    .myDiv {
    width: 500px;
    margin: 0 auto;
    text-align: left;
    }
    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.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Please help, I CANNOT figure this out
    By whosethere111 in forum JavaScript and CSS
    Replies: 2
    Last Post: 03-01-2011, 05:39 AM
  2. Simple CSS - but I can't figure it!!! Please help!
    By daraclare in forum JavaScript and CSS
    Replies: 4
    Last Post: 07-20-2010, 09:52 PM
  3. Figure this out
    By hbk in forum C and C++
    Replies: 4
    Last Post: 04-01-2010, 05:02 PM
  4. I can't figure out the 2 errors
    By Cassie836 in forum Java Help
    Replies: 2
    Last Post: 08-17-2008, 08:46 AM
  5. How to figure out if UAC is active?
    By vbigiani in forum General Programming
    Replies: 2
    Last Post: 03-05-2008, 12:17 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts