473,397 Members | 1,949 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,397 software developers and data experts.

IE compatible way of forcing footer to bottom of page?

Hi

When the height of the content of a webpage is less than the height of
the viewport, I would like to force the footer to the bottom of the
viewport; whereas when the height of the content of the webpage
exceeds the height of the viewport, then I would like the footer to be
at the bottom of the webpage (so not visible until you scroll down to
it).

I tried using the method described at http://tinyurl.com/2upa7l but it
doesn't work in IE6 or in IE5.5 (although it does work in IE7) - see
my mock-ups at http://tinyurl.com/2urjf2 (short content) and
http://tinyurl.com/393k5n (long content).

My problem is that (unfortunately) around 32% of users are still using
IE5.5 or IE6 (see http://tinyurl.com/56kp), and I therefore expect a
large percentage of the visitors to my site to be IE 5.5 and 6 users.

Is there any cross-browser-compatible way of achieving the above
objective?

Dave
Mar 28 '08 #1
5 4610
I've found the answer - the solution is described at http://tinyurl.com/a8u5w
.. It is almost identical to the method I was using but it includes the
following addtional line:

* html #nonFooter {height: 100%;}

With the addtion of this line, it works in all browsers including
IE5.5. I don't understand why it works though - does anyone understand
the significance of the asterix? And of what the difference is between
#nonFooter and * html #nonFooter?

Dave
Mar 30 '08 #2
In article
<c1**********************************@b64g2000hsa. googlegroups.com>,
Dave Rado <da*******@dsl.pipex.comwrote:
I've found the answer - the solution is described at http://tinyurl.com/a8u5w
. It is almost identical to the method I was using but it includes the
following addtional line:

* html #nonFooter {height: 100%;}

With the addtion of this line, it works in all browsers including
IE5.5. I don't understand why it works though - does anyone understand
the significance of the asterix? And of what the difference is between
#nonFooter and * html #nonFooter?
Morning, Dave. The asterisk in css is a universal selector and unless it
is over-ruled later in the style sheet will have all elements following
its dictates. Thus, to look at a common example, * {margin: 0; padding:
0;} causes all margins and paddings to be set to zero.[1]

The asterisk before the html element is an interesting case and it is
used to take advantage of what has appeared to almost everyone (except
me to a certain extent[2]) as a bad misconception of Internet Explorer
prior to version 7. Because IE is the only truly religious browserit
alone recognises an element higher than the html element, and so it
takes note of the style concerned. Whereas other more atheistic browsers
ignore such babble. This enables authors to talk to IE and tell it to do
things that will not bugger up the other heathen browsers.

------
1. This is something to be done with caution as it then requires the
author to supply all the margins and paddings that were supplied by a
default style sheet (or styles supplied by the browser code).

2. Because of my very deep studies into the mysteries of the html
element and beyond, I have caught glimpses of the Beyond that IE6 (and
lower) instinctively know about. In my case, I have had work hard in a
field that is unnatural to me. I wear a special black cape and a sort of
wizard's hat in my pursuit of what I am calling Root Studies.

--
dorayme
Mar 30 '08 #3
Hi dorayme

On 31 Mar, 02:41, dorayme <doraymeRidT...@optusnet.com.auwrote:
I find it easy enough to add an IE sheet and conditionally link it in
the head of the html.
My problem is that I'm finding some conditional css definitions are
needed just for IE5.5, others for IE6 and below, and still others for
IE7 and below, which means a potential requirement for up to three
conditional stylesheets (although Ben has just helped me get rid of
the "IE7 and below" one, unless I encounter another bug that applies
to IE 7 and below).

I'm already using a conditional stylesheet for IE5-specific styles,
but I do like the idea of using the * html hack to obviate the need to
have an "IE6 and below" conditional stylesheet as well; and it would
also be nice if there were a safe and reliable "IE7 and below" hack as
well, in case I find another bug that applies to IE7 and below but not
to IE8 beta.

I take your point about conditionals within the html body being very
useful at times.

Dave
Mar 31 '08 #4
In article
<e4**********************************@i12g2000prf. googlegroups.com>,
Dave Rado <da*******@dsl.pipex.comwrote:
Hi dorayme

On 31 Mar, 02:41, dorayme <doraymeRidT...@optusnet.com.auwrote:
I find it easy enough to add an IE sheet and conditionally link it in
the head of the html.

My problem is that I'm finding some conditional css definitions are
needed just for IE5.5, others for IE6 and below, and still others for
IE7 and below,...
Do yourself a big favour, forget about IE below 6. At least don't worry
about them unless they so distort your meaning that great disaster can
ensue. For example you have a fan base among traffic engineers in the
darkest and smallest states of Africa and you know they are using less
then IE 6 and you are outlining your latest traffic management plan...

--
dorayme
Mar 31 '08 #5
On 2008-03-31, Dave Rado <da*******@dsl.pipex.comwrote:
[...]
I'm still confused about some aspects of this. If you look at the last
mock-up I posted in the previous thread you helped me with ("Is it
possible to vertical align in a div?", and the mock-up at
http://tinyurl.com/2otuph)
That URL expands to
http://localhost/swindle/Dev/Mockups...lativeProb.htm
Apr 1 '08 #6

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

Similar topics

82
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | ...
6
by: Els | last post by:
Kris wrote: <quote> Liquid layout allows the footer to position itself at the end of the page, no matter how long or tall the page is. This is a Good Thing for various reasons that require a...
5
by: Tyler Carver | last post by:
I've tried to get CSS to give me a basic layout where I can place a footer at the bottom of the page and the top of the page I can use for content. I don't however want the footer to pull away...
17
by: Cerebral Believer | last post by:
Hi all, I would like to know how to get two rows of text links to appear at the bottom of a page. Generally I have been using <div> tags with the id attribute and CSS to place blocks of text,...
13
by: Greg | last post by:
Most suggestions on this topic recommend to use a page footer and make it visible only on the last page. My problem is that the footer is half of the height of a page which means the detail would...
1
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...
13
Death Slaught
by: Death Slaught | last post by:
I have my entire page in my "main" div. div.main { width: 100%; height: 100%; border: 1px solid gray; } on the left of the page I have a banner.
11
by: Michael7 | last post by:
Hi everyone, Me again, been a while since I've been here, but I'm back again needing help with a simple thing. I've searched for help on creating a footer, but all the help I've found, was...
13
by: Dave Rado | last post by:
Hi When the height of the content of a webpage is less than the height of the viewport, I would like to force the footer to the bottom of the viewport; whereas when the height of the content...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.