Position:absolute

design

#1

What I want to happen is to have my iframe positioned roughly six hundred pixels from the right of the screen, and for it never to move. The code I’m using is working to make it stay 180px from the top, but when I try to change distance from the right there is absolutly no effect.

I tried just making the iframe alot wider so it would move closer to the left, but it just made the right side of the screen extend further to the right!

Viewing the index through the ftp it shows the iframe where I put it(roughly), but when I load the whole page there is absolutely no change.

What am I doing rong?


#2

Link to a web page so we can see what you’re trying to do.

:cool: Perl / MySQL / HTML+CSS


#3

[quote]What I want to happen is to have my iframe positioned roughly six hundred pixels from the right of the screen, and for it never to move. The code I’m using is working to make it stay 180px from the top, but when I try to change distance from the right there is absolutly no effect.

I tried just making the iframe alot wider so it would move closer to the left, but it just made the right side of the screen extend further to the right!

Viewing the index through the ftp it shows the iframe where I put it(roughly), but when I load the whole page there is absolutely no change.

What am I doing rong?[/quote]
First of all, it is much easier for us to help you if you post a URL for us to look at. When dealing with absolute positioning, it is worth remembering the following rules:

  1. The positioned element is laid out in relation to its containing block.

  2. The containing block is defined as the nearest ancestor with a position other than static. If no such ancestor exists, the containing block becomes the root element of the document.

  3. If the nearest ancestor (whatever element contains the IFRAME) has a style rule of position:relative, the IFRAME will be absolutely positioned within that container.

If the nearest ancestor is the BODY element, I recommend wrapping the entire content in a DIV element, and then set it to position:relative. No offset is required to make it work. Then you should be able to use right: 600px on the IFRAME to put it where you want it. I can’t imagine why you should want to do this, but you’re the designer.


Simon Jessey
Keystone Websites | si-blog


#4

nevermind. The actual problem is nothing to do with my code. Working on this the other day I left it frustrated and set the code

position:absolute
top:180px
right:0px

but the iframe remained where I put it the first time, about 50px from the right. So I left it alone and when I went to start trying to fix it today it was in fact 0px away from the right side of the screen. When I tried to move it earlier nothing happened, but I waited a few hours and checked back and now it’s moved over.

So my real question since theres apparently nothing rong with my code, is why is it taking so long for this to happen?


#5

I haven’t the foggiest idea of what you are talking about. Visual CSS has no time-specific behavior, and code doesn’t change all by itself.

I repeat, if you want people to help you with this stuff, you must post a URL so that we can see for ourselves.


Simon Jessey
Keystone Websites | si-blog


#6

Sounds like you need to force your browser to refresh the page. If it’s IE, just hold Ctrl and click refresh. Missing semi-colons in the code you shared.

~Chell


#7

One of my clients has this problem with a RoadRunner cable connection. Apparently they cache pages.

Sometimes it takes several hours before she can see changes I make to her site.