English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Ok, I'm moderately experienced with CSS, but so far I've mostly used it to control the formatting of text and elements across my site, and I just started using it for positioning.

I need CSS positioning/layout to place a footer at the bottom of
http://montanalightphotography.com/landscapes.php

So far my main content area has these CSS properties:

width: 675px;

margin-left: 170px;

margin-bottom: 75px;

position: absolute;

top: 172px;

background-color: lightyellow;

border: 1px dashed gray;

padding: 0px 0px 0x 8px;

What CSS properties/values do I need to have a footer DIV appear, say 30 pixels below the above DIV?

2006-08-11 16:39:02 · 4 answers · asked by banjobarry 4 in Computers & Internet Programming & Design

4 answers

Absolutely positioned items need to be placed within relatively positioned containers, or containers that will appear where the browser assumes they'll appear.

1) Validate your code. You appear to have some basic HTML errors (http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fmontanalightphotography.com%2Flandscapes.php)

2) Use float positioning instead. Absolute positioning will require you to set a relatively positioned container around you absolutely positioned elements. Using floats, you can change your current HTML to this instead:

- line 25:

    to

      - line 50:
      to

      - line 91:
fedest.com, questions and answers