> You're right Bill ! The default margin were in due. Are you able to
> explain it ?
> 
> Cheers,
> 
> Sebastien F.

I think so. I didn't really examine your code, but had a basic idea that
 the trouble was being caused by a top margin somewhere. It's tough to
say because you're also using jquery, so in the beginning I had to
remove your javascript to ensure that the problem was being caused by
your CSS and not some setting in jquery.

Over simplifying the issue, what happens is that in some cases, a top
margin on a child can cause a parent tag to be "bumped" down. Read a
little about "collapsing margins" and I would also suggest a global
reset style sheet like Eric Meyer has posted on his site:
http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/

Georg raises another issue with regard to making your content entirely
javascript dependent. What he means, of course, is that when a user has
javascript disabled, but css ENabled, your content is entirely hidden.

To fix this, I move all my javascript dependent styles into a separate
style sheet, usually index_js.css for me and then load it when the page
is loaded using this script:
// Script Styles: Loads an external sheet for styling of scripted elements.
(function load_script_styles() {
        var dochead = document.getElementsByTagName('HEAD')[0];
        if (head) {
                var scriptStyles = document.createElement('LINK');
                scriptStyles.rel = "stylesheet";
                scriptStyles.type = "text/css";
                scriptStyles.href = "css/index_js.css";
                dochead.appendChild(scriptStyles);
        }
})();

On load, by the time the browser reaches that javascript, the head
element has to already exist, so this script autoruns, loading a style
sheet for user with javascript enabled, while allowing users with css
only to see a styled site, but without javascript hidden content and so on.

Hope it helps.
Bill


-------------------------------------------------
Bill Brown, http://www.TheHolierGrail.com
-------------------------------------------------
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to