FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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...
Related topics
W3C buttons without images
Azkabanweb.tk
Learning CSS
How to design a theme?
expanding image for div (rounded corners etc)
What is a site without tables?
image view tag
How to make a Html post in Phpnuke
Hover Buttons Completely with CSS
Problem with Table {HTML}
3 columns using div and css
Managing DIVS in CSS
div Tags
Scale an image to the size of the div
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Design Tips

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