473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Why won't my element stick to its corner?

Greetings.

Here is the scenario: I have an element div.aside which is absolutely
positioned in the bottom right corner of its containing box, div.frame.
Said containing box is then resized dynamically via a JavaScript snippet
which turns on or off display of material within the box. One would
expect the div.aside to then reposition itself on the screen so that it is
still in the bottom right of div.frame. And indeed it does in this
minimal example, viewed with Mozilla 1.7.5:

<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<title>foobar</title>
<style type="text/css">
.frame { border: solid thick black; position: relative;
padding-bottom: 3em;}
.para { border: dotted thin orange; }
.aside { position: absolute;
bottom: 0; right: 0;
border: dotted thin red; }
</style>
</head>
<body>
<div class="frame">
<div class="aside">
This should appear in the bottom right corner of the "frame".
</div>
<p class="para">
Here is a paragraph which should display at the top of the
"frame". <a href="#"
onclick="document.getElementsByTagName('blockquote ')[0].style.display =
'none'">Shrink "frame!"</a>
</p>
<blockquote>
Here is another paragraph which will disappear.
</blockquote>
</div>
</body>
</html>

This example can be viewed at
<http://www.dfki.uni-kl.de/~miller/tmp/html-bst/minimal.html>.

However, in my real-world, more complicated example, the bottom right
element does not reposition itself when the parent box is resized; it
stays right where it is, thus screwing up the layout. I'm not able to
figure out what's causing this behaviour. Is it a bug in Mozilla or am I
doing something wrong? Have I got my CSS file set up wrong or do I need
to invoke some JavaScript function which explicitly redraws the box?

The problem page in question can be viewed at
<http://www.dfki.uni-kl.de/~miller/tmp/html-bst/>. The style sheet is at
<http://www.dfki.uni-kl.de/~miller/tmp/html-bst/css/boxy.css> and the
JavaScript which I use to turn on/off the material within the enclosing
box is at <http://www.dfki.uni-kl.de/~miller/tmp/html-bst/showhide.js>.
The enclosing box is div.bibitem (which for convenience I have surrounded
with a dotted red border) and the bottom-right box is div.iconbox.

Any insights would be very much appreciated.

Regards,
Tristan

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Jul 23 '05 #1
1 1176
Greetings.

In article <23****************@ID-187157.News.Individual.NET>, Tristan
Miller wrote:
Here is the scenario: I have an element div.aside which is absolutely
positioned in the bottom right corner of its containing box, div.frame.
Said containing box is then resized dynamically via a JavaScript snippet
which turns on or off display of material within the box. One would
expect the div.aside to then reposition itself on the screen so that it
is
still in the bottom right of div.frame. And indeed it does in this
minimal example, viewed with Mozilla 1.7.5:


I've discovered the problem; in my real-world example, the div.frame was
wrapping another div. Changing this inner div's positioning to "relative"
solved the problem. I'm not sure why it didn't work the original way, but
at least I've found a workaround.

Regards,
Tristan

--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Steven Green | last post by:
I have a java app at work I used when I had Windows 98 and never had a problem. I did a clean install of Windows XP and of course Java was not included. I went to Sun, download Java 2 Runtime...
3
by: Markus Ernst | last post by:
Hello Reading the follwing document: http://www.w3.org/TR/WD-positioning-970131#In-flow it seems very clear that position:relative should be relative to the parent element. So in the following...
1
by: Tristan Miller | last post by:
Greetings. Here is the scenario: I have an element div.aside which is absolutely positioned in the bottom right corner of its containing box, div.frame. Said containing box is then resized...
1
by: Weston C | last post by:
Here's something I'm working on: for a click on a given element, I want to be able capture the x/y coordinates of the mouse -- that is, the mouse coordinates relative to the top left corner of said...
1
by: travis_brooks | last post by:
greetings I had a javascript that was reliably telling me the position of an image on a page, and now its not. I was using the script to draw a bounding box that followed the mouse around over...
7
by: David | last post by:
Hi, I'd really appreciate any help. Im trying to change a label over and over again. I can change it the first time, by using the following code, however it never works again, how can i do this...
3
rblaettler
by: rblaettler | last post by:
Hey I need to position an Icon OVER the right bottom corner of an other CSS element, but with variable height and width. So just absolute positioning would not work. I have something working with...
5
by: Summercool | last post by:
wow... i didn't know that, for <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:// www.w3.org/TR/html4/loose.dtd"> <span style="width: 100px; background:...
2
by: steven acer | last post by:
i'm illiterate when it comes to javascript and browser issues, i'm trying to code a small help module for my java app.i've went far enough coding all the server side but i'm stuck with javascript...
12
by: Daniel | last post by:
Given the following lines of code . . . System::Collections::Generic::List<unsigned intls(1000); String^ datum = "12345"; How would I change datum into an unsigned integer value and put it in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.