One more html question…
- Started
- Last post
- 14 Responses
- T-B-O-A
Does anyone know how to get a div to stop 10px from the bottom of the page ? (if it has enough content to be this long in the first place)
Thanks
- jevad0
give the body 10px padding at the bottom duder
- T-B-O-A0
Sorry, I meant at the bottom of the screen – the visible part of the page – so the div has a scroll instead of the page
- jevad0
confused me - you want a scrolling div that will stop 10px from the bottom of the page?
Got anything online?
- Kevin_Sweeney0
if you want a div with lots of content that's going to expand, it will either expand past the screen (causing your browser to need to scroll) this is because as of right now, the W3C has stated that websites should be defined as having a finite width, but infinite height.
if you want a div that will scroll (like an iframe), just add the rule...overflow: auto; or overflow: scroll; auto will add scroll bars as the content needs them, scroll will give you both sets of scroll bars by default (including the dreaded horizontal one, so you best bet is probably auto)
hope this helps
- Hym0
so dependable on the size of the browser window, the height of your div has to change ?
not possible
- Kevin_Sweeney0
sure it is. use javascript to grab the height of the user's window, and then feed that number into your div's css height property.
- T-B-O-A0
Thanks,
At least I won't be spending any more time trying to figure it out.
- Kevin_Sweeney0
just make sure that you put onResize=history(0) or whatever the proper code is for that in your body tag in case the user changes the size of their screen, the page will refresh and a new number will be generated by your js
- ********0
You could javascript it: get the height of the page, then document.write the div height..
- T-B-O-A0
sure it is. use javascript to grab the height of the user's window, and then feed that number into your div's css height property.
Kevin_Sweeney
(Jul 12 05, 20:02)That sounds like too much work for me (I'm more of a print person, amateur when it comes to the web). Plus, it's 4.16 am here, I need to get some sleep
Thanks though
- Hym0
do you mean window.innerHeight in javascript ?
that doesn't work in IE
- bk_shankz0
You could use a table.
- Hym0
ok possible but still not very nice if you ask me
http://www.alistapart.com/d/foot…
that's all the javascript you need
- bk_shankz0
Honestly it shouldn't be that complicated. basic layout techniques should be available with basic css. I think somebody fucked it up.