Peter said:
I've got a problem in Firefox using absolute positioning on a div within
a relative box. The div is positioned bottom right which seems to work
OK in most browsers, including Safari. Firefox (1.0 & 1.01) however
seems to remember it's last position when a new page loads.
If the new page is taller than the previous page the box will stay in
it's original position. A reload fixes the problem.
..bottomline {
position:absolute;
bottom:0;
right:0;
}
That's the consequence of the way (implementation) bottom: 0 was
implemented.
Bug 105286: viewport used as containing block for absolutely positioned
elements instead of root (percentage height, %, bottom)
https://bugzilla.mozilla.org/show_bug.cgi?id=105286
Comment #58
https://bugzilla.mozilla.org/show_bug.cgi?id=105286#c58
explains this:
"CSS2.1 section 10.1 clearly says that the containing
block of absolutely positioned elements that don't have a positioned
ancestor is the initial containing block, which the working group agrees
is, for desktop browsers, the viewport."
I've searched on bugs related to absolute / relative positioning but
these came up empty.
The website is
http://www.estetika.org, the box appears on all pages, at
the bottom righthand side.
If someone knows what I can do to fix this, I'd be gratefull!
thanks,
Peter
A few comments on your webpage code, in particular your CSS code.
- You misuse CSS code in several ways. For starters, your external
stylesheet has 623 lines of code (hundreds of declarations) when the
markup has 5 times less code.
- You misname styled elements. The best identifiers for class and id
attributes are the ones which describe what are the content for these
elements for, what they do, not how they are styled.
e.g.: .pink {color: fuchsia;} // is very bad way to create a rule
while
strong, .ImportantNotice, .Warning {font-weight: bolder; font-size:
125%;} // is a lot better for site maintenance purposes
- Your CSS code entirely ignore default browser css values; your CSS
code ignore inheritance. You declare margin:0 and padding:0 a few dozens
of times for elements which never have default margin and padding for
such elements. I think you misunderstand how layout works (block-level
elements, pos. elements, etc); so you end up over-constraining,
over-declaring elements and rules.
I highly recommend you:
1- StyleSheet perfection: How to write the perfect style sheet - always
looks perfect, whatever the browser; easy to maintain; quick to download
http://www.richinstyle.com/masterclass/perfection.html
2- Writing Efficient CSS (in particular the Guidelines for Efficient CSS
section):
http://www.mozilla.org/xpfe/goodcss.html
DU