Hi to All,
I am new to html authoring, so sorry if my terminology is not correct or
exact.
I would like to position a footer div to the bottom of the browser window.
As I research in the web shows this could be done a containing element with
"min-height: 100%;" and an absolute positioned element (div) inside, aligned
to bottom ("position: absolute; bottom:0px")
But here is the problem comes: Sometimes my page filled with more content
and vertical scrollbar shows up. In this case the bottom aligned footer not
aligned to the bottom of the containing div, but aligned to the bottom of
browser window (viewport?). This gives an erratic render because the footer
is in the middle of the content.
How can design the layout to statisfy this 2 requirement:
1) If the dynamic content of my page is less height than the browser window,
than the footer shows up at the bottom of the window
2) If the dynamic content of my page is more height than the browser window,
than the footer shows up at the bottom of the content, so we can scroll down
to see it?
thx for answer. 4 29154
On 2007-02-19, john <jo**@nospam.comwrote:
Hi to All,
I am new to html authoring, so sorry if my terminology is not correct or
exact.
I would like to position a footer div to the bottom of the browser window.
As I research in the web shows this could be done a containing element with
"min-height: 100%;" and an absolute positioned element (div) inside, aligned
to bottom ("position: absolute; bottom:0px")
But here is the problem comes: Sometimes my page filled with more content
and vertical scrollbar shows up. In this case the bottom aligned footer not
aligned to the bottom of the containing div, but aligned to the bottom of
browser window (viewport?). This gives an erratic render because the footer
is in the middle of the content.
How can design the layout to statisfy this 2 requirement:
1) If the dynamic content of my page is less height than the browser window,
than the footer shows up at the bottom of the window
2) If the dynamic content of my page is more height than the browser window,
than the footer shows up at the bottom of the content, so we can scroll down
to see it?
Using min-height:100% as you suggest should do exactly that, it may be
that it's just not working in the browser or browser-shaped-object
you're trying it in.
You do need the container (the one that's height:100%) to be positioned
as well, and if it's relatively positioned (as opposed to absolute or
fixed), you may need something like html, body { height: 100%; } to make
sure the percentages are all there and resolvable all the way up to the
viewport.
Even in a browser where this does work (Firefox), ISTR you get some
nasty effects when the user resizes the viewport, as if it were failing
to reflow completely with the new viewport size.
Mon, 19 Feb 2007 09:22:30 +0100 from john <jo**@nospam.com>:
I am new to html authoring, so sorry if my terminology is not correct or
exact.
What, you didn't like the answer you got the first time?
http://groups.google.com/group/comp....aa220a75c666b5
Please don't waste the group's time by posting the identical question
more than once. If you didn't understand something about the original
answers or need to discuss them further, follow up to the original
thread and don't start a new one.
And in particular, don't waste time by posting the identical copy to
the *wrong* group. There's a CSS group, where you asked your question
first. Posting it again to the HTML group is doubly wrong.
[followups to comp.infosystems. www.authoring.stylesheets]
--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You: http://diveintomark.org/archives/200..._wont_help_you
john skrev:
Hi to All,
I am new to html authoring, so sorry if my terminology is not correct or
exact.
That's okey, but the answer to your question hurts my feelings.
I would like to position a footer div to the bottom of the browser window.
As I research in the web shows this could be done a containing element with
"min-height: 100%;" and an absolute positioned element (div) inside, aligned
to bottom ("position: absolute; bottom:0px")
Let it flow, you don't need to use absolute positioned elements.
Absolute positioned elements "is removed from the normal flow entirely
(...)". http://www.w3.org/TR/REC-CSS2/visure...te-positioning
But here is the problem comes: Sometimes my page filled with more content
and vertical scrollbar shows up. In this case the bottom aligned footer not
aligned to the bottom of the containing div, but aligned to the bottom of
browser window (viewport?). This gives an erratic render because the footer
is in the middle of the content.
Absolutely positioned boxses "(...) may or may not obscure the
contents of another box, depending on the stack levels of the
overlapping boxes." http://www.w3.org/TR/REC-CSS2/visure...te-positioning
How can design the layout to statisfy this 2 requirement:
1) If the dynamic content of my page is less height than the browser window,
than the footer shows up at the bottom of the window
2) If the dynamic content of my page is more height than the browser window,
than the footer shows up at the bottom of the content, so we can scroll down
to see it?
With nested dividers and IE hacks:
<head>
<title>Dynamic Content without Irritating Enviroment</title>
<style>
html, body { margin: 0; padding: 0; height: 100% }
.main { position: relative; min-height: 100% }
.content { padding-bottom: 3em }
.footer { position: relative; margin-top: -3em; height: 3em }
</style>
<!--[if lt IE 7]>
<style type="text/css">
.main { height: 100% }
</style>
<![endif]-->
</head>
<body>
<div class="main">
<div class="content">Content</div>
</div>
<div class="footer">Footer</div>
</body>
john skrev:
Hi to All,
I am new to html authoring, so sorry if my terminology is not correct or
exact.
I would like to position a footer div to the bottom of the browser window.
As I research in the web shows this could be done a containing element with
"min-height: 100%;" and an absolute positioned element (div) inside, aligned
to bottom ("position: absolute; bottom:0px")
Let it flow, you don't need to use absolute positioned elements.
Absolute positioned elements "is removed from the normal flow entirely
(...)". http://www.w3.org/TR/REC-CSS2/visure...te-positioning
But here is the problem comes: Sometimes my page filled with more content
and vertical scrollbar shows up. In this case the bottom aligned footer not
aligned to the bottom of the containing div, but aligned to the bottom of
browser window (viewport?). This gives an erratic render because the footer
is in the middle of the content.
Absolutely positioned boxses "(...) may or may not obscure the
contents of another box, depending on the stack levels of the
overlapping boxes." http://www.w3.org/TR/REC-CSS2/visure...te-positioning
How can design the layout to statisfy this 2 requirement:
1) If the dynamic content of my page is less height than the browser window,
than the footer shows up at the bottom of the window
2) If the dynamic content of my page is more height than the browser window,
than the footer shows up at the bottom of the content, so we can scroll down
to see it?
<head>
<title>Dynamic Content without Irritating Enviroment</title>
<style>
html, body { margin: 0; padding: 0; height: 100% }
.main { position: relative; min-height: 100% }
.content { padding-bottom: 3em }
.footer { position: relative; margin-top: -3em; height: 3em }
</style>
<!--[if lt IE 7]>
<style type="text/css">
.main { height: 100% }
</style>
<![endif]-->
</head>
<body>
<div class="main">
<div class="content">Content</div>
</div>
<div class="footer">Footer</div>
</body> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Harald Kirsch |
last post by:
In the W3C document about CSS2, I read at
http://www.w3.org/TR/REC-CSS2/visuren.html#choose-position
the following:
absolute
The box's position (and possibly size) is specified with the...
|
by: Tristan Miller |
last post by:
Greetings.
I am trying to figure out how to use CSS to position an element in the
bottom right of its containing element. I thought this would be
accomplished using "position: relative; bottom:...
|
by: Gérard Talbot |
last post by:
Hello fellow stylers,
When trying this page
http://www.gtalbot.org/BrowserBugsSection/PercentualRelativePositioning.html
I get different rendered layouts with IE 6, IE 7 beta 2, Firefox...
|
by: Bill Norton |
last post by:
If you wrap one division around another like this:
<div id="wrapper">
<div id="child">...</div>
</div>
....the wrapper division will be considered the containing block of the child
division...
|
by: Robert |
last post by:
Hi,
I am currently trying to do some Javascript sizing and positioning using
Javascript and encounter some for me unexpected behaviour in IE6, yet
works fine in Firefox and Opera.
I have a...
|
by: nonsensitor |
last post by:
I'm just learning xhtml & css, primarily from westciv's online tutorials and css guide. I've run into a couple of problems with a page I'm developing that I can't figure out.
The first problem is...
|
by: john |
last post by:
Hi to All,
I am new to html authoring, so sorry if my terminology is not correct or
exact.
I would like to position a footer div to the bottom of the browser window.
As I research in the web...
|
by: soulmach |
last post by:
Hello forum friends. I performed a search on this topic, but I couldn't find anything useful. I wasn't really sure what to search.
First I'll state what I am trying to do. I recently agreed to...
|
by: Frinavale |
last post by:
Hi!
I'm attempting to display a <div> element on top of my page's content so that the user cannot interact with it while being prompted to answer a question. I have set this <div> to have a...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: ezappsrUS |
last post by:
Hi,
I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
|
by: jack2019x |
last post by:
hello, Is there code or static lib for hook swapchain present?
I wanna hook dxgi swapchain present for dx11 and dx9.
|
by: F22F35 |
last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...
| |