Hi, not sure if I’m posting this in the right area.
I have built a pretty basic site using HTML and CSS. It seems to work correctly in ie7 but the divs don’t seem to line up properly when using firefox or chrome.
Could someone take a quick look and advise how I can get it to work in all browsers? URL is houseofcash.co.uk
I noticed that your mainContent div doesn’t have a float so it doesn’t take part in the flow. You use margin-left 30; for the mainContent div but since it doesn’t has a flow the margin-left is 30px left of the container edge instead of from sidebar1, as I presume you want . Try to add a float to that div:
I noticed that and i was trying to edit my reply before but this site was down for some time, at least for me. What I wanted to say than, was that actually FF and Chrome are centering your site as you would expected:
where in all IE versions the site aligns left and your main content is pushed downwards. I’m sure there is a unclosed or overlapping tag somewhere. I was going trough your site but couldn’t find though.
I think you should go through the entire page and your stylesheet as well, both of them need some serious clean up. Your site for example won’t even validate at W3 W3 Validator
now I have added that into the top of my html the divs are nearly working correctly, however it has now shifted the whole website to the right by about 50px!
could someone please take another look at this annoyance?
I have also noticed the footer isn’t displaying in the correct place.
I beleive both of these issues are related to my css file, but I cannot find the error.
Any whitespace before the doctype would keep IE6 in Quirks mode, but if HOC didn’t have a doctype to begin with and the site was looking ok in IE then I would assume the page was built for Quirks Mode (a bad thing because it usually means you have to rewrite to have something working in ALL browsers, with doctype).
Remember wherever you have something floated, the next thing to come after it, if you want it to always stay under the float, needs to clear the float with
clear: both
usually. Usually this is the cause of woggy footers.