Grow your CSS skills. Land your dream job.

Simple CSS Being Rendered Differently in Chrome & Firefox

  • # March 9, 2012 at 6:51 pm

    Well, it’s safe to say that I am stumped here. Note how the page renders very differently in regards to the fixed div in Chrome and Firefox. Firefox (and Opera, for that matter) are displaying expected behaviour. Why is Chrome giving me trouble?

    Any help would be greatly appreciated!

    http://dabblet.com/gist/2009339

    # March 9, 2012 at 7:19 pm

    thats very weird, Looks like a bug in webkit
    Is this right? http://dabblet.com/gist/2009425

    # March 9, 2012 at 7:20 pm

    Oh nevermind, that works in chrome but broke it in firefox

    # March 9, 2012 at 7:21 pm

    Think I got it now

    http://dabblet.com/gist/2009433

    # March 9, 2012 at 7:39 pm

    Ah! Interesting choice of using the margin. I still think that’s not really solving it, but it’s a smart one! I actually went a different route:

    http://dabblet.com/gist/2009473

    The code might not be complete, but you should get the idea!

    # March 9, 2012 at 7:46 pm

    I guess because you don’t define a left position for #sidebar, you leave it open for interpretation. Seems like Webkit defines the left position the same as the original location of it’s parent #sidebar-wrap (and not follow the new position that is controlled by it’s relative move), whereas Mozilla “follows” the location of its parent.

    @karlpcrowley ‘s solution works because it takes the position:relative out of the equation and that’s where both browser types disagree.

    I think :)

    # March 11, 2012 at 5:31 pm

    All you need to do is change #sidebar to position: relative on the original and it will move back inside the sidebar-wrap.

    Have you considered using floats instead for your columns & layout? It may make it much easier moving forward.

    # March 11, 2012 at 10:57 pm

    Hey Andy, the example provided was a super simplified version just to show the browser differences. The actual site is a little more complex and requires a small set of icons to always be visible.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".