Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with positioning objects with CSS

Status
Not open for further replies.

SpecSys

IS-IT--Management
Apr 3, 2002
136
US
I am having a heck of a time figuring out CSS positioning. For the most part I have it down pretty solid, but there are some <div> elements that I can't seem to put where I want them. I like CSS over tables now that I have tried it, but for the life of me I can't figure out how to make an image or div object sit at the absolute bottom of a page. I can get it to sit at the bottom of the browser page, but not at the expanded bottom.

Not sure if I explained this correctly...

When I open up the browser I want to see the image at the bottom of the page when I scroll to the bottom, NOT where the bottom of the visible browser window when it initially opens up (i.e. if I tell it position: absolute; bottom 0px;)
 
Code:
document.all(&quot;theFloater&quot;).style.pixelTop = 
		(document.body.clientHeight + document.body.scrollTop) - 80;
where &quot;theFloater&quot; is the id of your div and '80' is the height of the div in my case so that can be determined dynamically if you want.

good luck
-pete
 
That doesn't appear to be css...is that java? THe only two languages I know are xhtml and css, and I know them quite well. I just don't have any experience in anything else. I will give this a try and see for myself. Thanks!

 
oh man, sorry,

yeah it is because it has to be dynamic right, you don't know the height of the window when your creating your css yes?

-pete
 
oh, maybe i still have not understood your post.

you want to be at the bottom of all the HTML elements using absolute positioning, even if it's off the bottom of the browser's viewport, is that correct?

-pete
 
exactly. I have a bunch of content that is obviously going to make the browser need to scroll to see it all, yet I want the footer image to appear at the bottom of the html document and NOT just at the bottom of the browser window, where it stays locked when it scrolls. (which is what position:absolute does)

I don't want to see the image when the browser loads, I want to see it when I scroll to the bottom of the doc.
 
ok, geezz i'm really dorking out with this.

it's still a &quot;relative or dynamic&quot; position though since you can't just put a pixel position in because you don't know what it is until after the page renders. That is the reason you can't do it with just CSS you need DHTML to make it happen using &quot;absolute&quot; position.

So whew! Why don't you just put it at the bottom of the page?

-pete
 
well, I have been trying that now, just sticking a <div> or a <table> with a 100% width and a small height value in right before the closing <body> tag but I haven't even had that show up yet, and I don't exactly know why. It may be because it is still inside the <body> tag with has css property for bg and positioning. It seems that my HTML formatting should overide that though...hmmm
 
did you disconnect the CSS absolute positioning?

-pete
 
hmmm, guess I don't know what you mean exactly..

The table I am trying to create is just simple and independent of the css stylsheet. But it doesn't seem to show up at all.

Could you explain better what you mean?
 
I'm obviously missing something here,

If I put an image at the bottom of a page, after all the content, that is where it will appear, no matter what browser, resolution or OS I happen to use and without using CSS to position it.


Chris.

 
every image on my page is positioned absolute or relative with css. If I add an image to the bottom of the html doc, its not actually at the end of the content because some one the html content is being absolutely positioned differently. I am lost myself and will just have to work through this. I still don't even know if there is a way to get an image to position itself off screen at the bottom though.
 
SpecSys, is your server public? give us the url so we can look at it.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top