Skip navigation
Currently Being Moderated

Off centre Layout?

Feb 12, 2013 3:48 AM

Why is everything off centre apart from the container and banner?

 

http://www.milesmemorials.com/

 
Replies
  • Currently Being Moderated
    Feb 12, 2013 5:36 AM   in reply to Ness_quick

    Because you're using absolutely positioned elements. Please read about positioning:

    http://css-tricks.com/almanac/properties/p/position/

     

    So a quick recap:

    Static: default positioning, follows the normal flow of the document. Generally you should always use this (which means you actually never have to declare it since it's the default positioning of all elements).

    Relative: element remains in the flow, but can now take left/right/top/bottom CSS attributes to position it relative to its normal position

    Absolute: removes element from the normal document flow. Positioned absolutely on the page (or from it's parent element if that parent element has a position declared (i.e. not static) and a defined width).

    Fixed: element removed from document flow, "fixed" in a position relative to the document - often used on navbars or footers that you want to always show up in a set area on the page.

    Inherit: position does not cascade so if you want a child element to inherit it's parent's positioning, use inherit.

     

    Then to add to this complexity there are floats: float: left, float: right. But that's another lesson.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points