Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Absolute centered div alongside fixed sidebar

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #208974
    modiophile
    Participant

    I have a header image that is absolutely centered in relation to the body of of my website with a fixed sidebar at its left.

    It works perfectly until the viewport gets too small whereby the header images starts getting hidden by the sidebar before the sidebar gets a chance to auto-hide. See, http://codepen.io/modiophile/pen/PPWbRZ

    How do I go about factoring in the fixed sidebar as part of the calculation so as to stay centered in the content area without being hidden by the sidebar?

    #209007
    modiophile
    Participant

    Thanks for the suggestion! I was using ‘margin’ instead of ‘padding’ thus causing the “parallax-group” div to not scale in proportion to the body of the webpage and forcing a horizontal scrollbar to appear as was happening in my pen.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.