Hi all, I just need a really simple box-like container. I need it to be centered, regardless of resolution or browser. I've tried this code below but it's not really working - any suggestions? Thanks html, body { height: 100%; background: url(grey.jpg) } #container { min-height: 100%; width: 1000px; margin: 0 auto; font-family: sans-serif; background-color: black; } * html #container {height: 100%;} /*no min-height for lte IE6*/ Code (markup):
What doctype are you using for your html document? also what browsers is it not working for? if no doctype is declared and you load that into IE it won't center, but if you do a doctype of xhtml transitional it should center. so I suggest trying this at the top of your file. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> Code (markup):
No problem, It is a very common mistake. Just make sure you you do things like that and it works in one browser but not another check the w3 site, they have nice charts for what works with which doctype.