Profile image for Gabriel Feippe feippe
How to put a div in the middle of the window.
Language
CSS
Tags
center css div
Favorited By
Profile image for kaine smith Profile image for Patrick Westerfeld Profile image for stefan pettge Profile image for Aizan  Fahri Profile image for Tom Hancock Profile image for Gabriel Feippe Profile image for zafer onay Profile image for Dalvir Singh Profile image for Rakesh Kumar Profile image for Joshua Canfield Profile image for Der Dools Profile image for Thomas Brekkan Profile image for Ben Bytes Profile image for ~ ~ Profile image for Ku Bin Profile image for Bimal Patel Profile image for Mati D Profile image for Greg Berlin Profile image for Mikkel Rask Profile image for Marcus Stephens

Center a DIV with CSS

1 #idOfTheDiv { 2 width: 400px; /* here you put the width that you need */ 3 height: 200px; /* here you put the height that you need */ 4 position:absolute; 5 left:50%; 6 top:50%; 7 margin-left:-200px; /* this number always to be the width divided two in negative */ 8 margin-top:-100px; /* this number always to be the height divided two in negative */ 9 }

Comments

Profile image for Kobus Myburgh bliksempie 2013-11-14

Very nice! Thanks. Helpful!

Profile image for Robert Christian Obias rchristianobias 2014-05-29

another way would be

#idOfTheDiv {
margin: 0 auto;
}

Profile image for sell cvv good good sell sell cvv good 2016-11-27

Hello Everyone
= >GOOD WORK AROUND THE WORLD ABOUT ..THE AND CASH BASIS OF INFORMATION
== > WANT BUSINESS GOOD LONG-TEARM CONTACT ME ....

-Sell CC All Country 100% fresh with high balance.
(United States,Australia,Canada,France,United Kingdom,Spain,Italy,Indonesia,Germany,Norway,Denmark
Brazil,Sweden,New Zealand,Ireland,Switzerland,Turkey,Belgium,Japan,Mexico,Netherlands,India,Finland
South Africa,South Korea,Greece,Singapore,Reunion,Saudi Arabia,Guadeloupe).

-Sell US + UK CC Full Info

-Sell Dumps Cards.Track 1 &2

-Sell USA Full Information (Name/Address/SSN/Dob/DL/City/State/Zipcode/phone)

-Sell Paypal Account + Internet Account(Mail Pass/walmart/ebay/target/bestbuy..more.....).

Shipping

-Order Items For reseller of Store(Shop) Online share %.

-Registration account online (with Payment to register) suitable for Affiliate Marketing partners (CPA ~ PPA).
-Booking Hotel / Plane Ticket all country.

- Accept payment: PM(Perfect Money) - WMZ(Web Money) - BTC(Bitcoin) & WU-MG with Reguler buyer.

Contact Us

--- ICQ : 693210120

--------- Mail : tieuchieu.59@gmail.com

Thank you for read my post and hope to work with you soon

Have a nice day

=============== THANKS MUCH ========================