FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Question: Div center with css

 


krazycapital
Does anyone know how to center a div with css only? I can get it to work with firefox, but again, I'm foiled by IE. Does anyone know how? Please help. Thanks!
ignotus
Hi Krazycapital:

To center a DIV using CSS, try:

margin: auto;

This should help Smile. If it doesn't, dont' hesitate to PM me and let me know!

Adios and have fun!
krazycapital
That works in firefox, but in IE it doesn't work. Thats what I have right now.
polarBear
body{margin:0px auto;text-align:center}

.yourDivsClass{
margin:0px auto;
}


that will do the trick
krazycapital
No actually, it isn't. Or is it just my version of IE? I've tried that already.
krazycapital
Oops. Thanks. It worked. It had it in cache though and I didn't know at first. Thanks! I always forget to clear the cache...
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.