Home > Uncategorized > How To Center A Div In Css?

How To Center A Div In Css?

I search google and yahoo answer but i couldn’t solve my problem!
I write my web page in Notepad (I’m a beginner) later i’ll write in asp.net… anyway, I can’t center my div (i want the div be in the center of the screen (from left and right) )!
i used: align: center; …. text-align: center; …. margin: 0 auto 0 auto; …. margin: 0 auto; BUT I COULDN’T DO IT!!!!!!!!!! PLEASE HELP ME OUT!!!
THANKSSSS!

Uncategorized
  1. Serjeniu Jun 15th, 2010 @ 01:04 | #1

    put the main wrapper on margins auto .wrapper{margin:auto ;}

  2. Dayanand G Jun 15th, 2010 @ 03:17 | #2

    Hi,
    I know is by adding align=center like this:

    But I want to put the center property inside a style class, like this:
  3. J Jun 15th, 2010 @ 05:14 | #3

    You don’t need a wrapper, and you don’t need align= either…
    margin: top auto [bottom]; is the correct syntax, this creates margins on both sides of the object which stretch as far as they can within the parent container.
    PS: Notepad is good, interface editors suck really… Download notepad++, same control, extra help.
    Also, PHP is far better and more widely used than ASP.NET

Submitting Comment, Give me a second...

Leave a comment

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackbacks & Pingbacks ( 0 )
  1. No trackbacks yet.
  2. Trackbacks are currently closed.