Posted By

luman on 08/05/06


Tagged

div center align


Versions (?)


Advertising

Website Promotion DIRECTORY is a crucial factor for all websites that need to gain better organic search engine rankings and increase website traffic.
Submitting your website as part of your Web Promotion strategy to our SEO friendly and high traffic Business Directory for review is an excellent way to gain a valuable backlink and increase your websites visibility online.

Submit Site


Who likes this?

46 people have marked this snippet as a favorite

designerd
meth
gardano
panatlantica
szsk
damarev
px
Krullies
pckujawa
zensir
visualAesthetic
banjomamo
tavo
jacksont123
icarus
manub
fael
tidbit
rich13
vali29
starprojector
Wizzle
joellevin
Baris
isaac
SpinZ
sudhakmy
asturi
Nix
ozayo
inkdeep
piticstyle
thinkcirca
Bluewall
owais
dardanmex
soren121
sheedy
tmbrenneke
Pixxell
Milad
sspitler01
GandalfGrey
xpoint
alexteg
davidsi


Horizontal-Vertical div align


Published in: CSS 






Expand | Embed | Plain Text
  1. #mydiv {
  2. position:absolute;
  3. top: 50%;
  4. left: 50%;
  5. width:350px;
  6. height:300px;
  7. margin-top: -150px; /*set to a negative number 1/2 of your height*/
  8. margin-left: -175px; /*set to a negative number 1/2 of your width*/
  9. border: 2px solid #2982C6;
  10. background-color: #FFF;
  11. text-align: center;
  12. }

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: soren121 on June 2, 2009

Excellent snipplet, works great if you need to center a non-expanding div like a login form.

You need to login to post a comment.

Download royalty free graphics