Hie I am having problems with margin collapse on my site. I have spent hours trying to solve it but still cannot solve the problem. The margin is collapsing in Internet Explorer, Safari and Firefox.
I have noticed the problem is with the header which is a php include. I am self taught so there might be something I am missing which may be really basic so please bear with me.
I have tried adding padding top and bottom of 1px, floated the div as well, right and left following advice from other sites.
When I had margin collapse before it worked when I added padding but this time nothing seems to work.
Here is my html: <div class=\"all-content\"> <?php include(\"includes/header-nav.php\"); ?> <div id=\"main-image\"><img src=\"images/men-image.jpg\" class=\"men\" alt=\"Olympia Fitness Centre\" /></div> <div id=\"content\"><h1>Olympia Fitness Centre : Currently Under Construction</h1></div> <?php include(\"includes/footer.php\"); ?> </div>
And here is the css: body{ margin:0px auto; width:100%;}
/***************************The wrap div **************/ .all-content{width:100%;}
Thank you for your prompt reply, I tried what the article says I should do, e.g use padding instead of margin and instead of floating elements push them to the relevant side by adding padding to the parent but I did not achieve the desired results, maybe I am doing it wrong so may you please let me know where exactly to add the code and what to remove. I have put the code back as it was, so it is still the same code I posted above.
i just saw your code and i think there is a problem because of this class id="main-image" just delete this class from your stle sheet and make a new class and only define the black background color nothing else.. may be your problem get solved.
I am having problems with margin collapse on my site. I have spent hours trying to solve it but still cannot solve the problem. The margin is collapsing in Internet Explorer, Safari and Firefox.
I have noticed the problem is with the header which is a php include. I am self taught so there might be something I am missing which may be really basic so please bear with me.
I have tried adding padding top and bottom of 1px, floated the div as well, right and left following advice from other sites.
When I had margin collapse before it worked when I added padding but this time nothing seems to work.
Here is the Header code:
Any help much appreciated.
Regards
http://css-tricks.com/ie-css-bugs-thatl ... very-time/
Thanks
Is there anyone who can help?
i just saw your code and i think there is a problem because of this class id="main-image" just delete this class from your stle sheet and make a new class and only define the black background color nothing else.. may be your problem get solved.