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

Absolute Positioning Weirdness

I have a strange problem that I'm hoping someone can help me with.

I want a footer at the bottom of my simple HTML page to span the entire
width of the page. I'm not using floats, columns or any other such complex
things. Here is the ridiculously simple markup I'm using:

<body>
<div id="footer">A Simple Footer Test</div>
</body>

And the style sheet markup that goes with this is:

body {
margin: 0;
padding: 0;
}
#footer {
background: #933;
color: #FFF;
position: absolute;
bottom: 0px;
width: 100%;
}

Here's the problem. This shows up in IE just fine (the footer area spans the
entire document width). In Mozilla 1.5, the browser I use most often, the
DIV appears off the page a little (the horizontal scroll bar shows up, even
though it ideally shouldn't). When I make some changes to the #footer CSS
style, it shows up just fine in Mozilla (no scroll bar and it spans the
entire width) but is broken in IE (the footer does not span the entire
document width). Here is that altered code:

#footer {
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
}

What is going on here? Mozilla gets the latter code snippet right, and that
seems like the better way of doing it (I'm "pinning", so to speak, the sides
of the DIV to a certain location). But IE breaks on that code. Ironically,
I'll be displaying this HTML in IE all the time (I'm writing an application
using the CHtmlView class in MFC), so the first snippet is fine. I just want
to know if I'm going about this the wrong way and why Mozilla (which seems
to be *way* more standards compliant than IE) gets it "wrong".

Any ideas?

Jonah
Jul 20 '05 #1
3 2081
Jonah Bishop wrote:
I want a footer at the bottom of my simple HTML page to span the entire
width of the page. I'm not using floats, columns or any other such complex
things.


Loose the positioning, simply insert the html as the last element on the
page.

--
Spartanicus
Jul 20 '05 #2
Well, I'd like the footer to be at the bottom of the "window" so to speak. I
know fixed positioning would do this, but here is what I'd ideally like:

When the page is too short to require vertical scrolling, the bar should
appear at the bottom of the window. When it does require scrolling, it
should appear at the bottom of the document. Is this even possible?

Jonah

"Spartanicus" <me@privacy.net> wrote in message
news:k5********************************@news.spart anicus.utvinternet.ie...
Jonah Bishop wrote:
I want a footer at the bottom of my simple HTML page to span the entire
width of the page. I'm not using floats, columns or any other such complexthings.


Loose the positioning, simply insert the html as the last element on the
page.

--
Spartanicus

Jul 20 '05 #3
Jonah Bishop wrote:
When the page is too short to require vertical scrolling, the bar should
appear at the bottom of the window.
I doubt that it's possible to do that.
When it does require scrolling, it
should appear at the bottom of the document.


Fraught with problems if you want it to work cross browser afaik.

--
Spartanicus
Jul 20 '05 #4

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

Similar topics

7
by: Griff Miller | last post by:
Please see http://home.houston.rr.com/gmiller15/css/vertprob.html . In mozilla 1.6/1.7 it looks the way I want it, with a thin separation between the two boxes. In IE6, the two boxes touch, which...
4
by: mike eli | last post by:
Hi, I have several absolute positioned elements inside an absolute positioned DIV. I would like one of the nested elements to have a dynamic width. I set it's left and right attributes to 5, so...
4
by: Alan Silver | last post by:
Hello, Having been a light reader of this ng for a few months now (after several years absence), I have noticed that absolute positioning seems to be considered a Very Bad Thing around here....
3
by: horusprim | last post by:
Is there a CSS absolute positioning rendering bug in FF1.02 and IE 6? I have been experimenting with precision absolute positioning in CSS. The following test content was used in the...
2
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...
6
by: Mark | last post by:
hi, i'm trying to position something in the top right corner of a container, but i can't seem to figure out how to get it working. here's the html <div class='thumb'><a href='image.jpg'><img...
1
by: rhino | last post by:
I've got some positioning problems that I can't figure out. Can anyone help? My website was working fine in IE7 and the current releases of Firefox and Opera so I had a look at it in IE6 and...
20
by: mehstg1319 | last post by:
Hi there Not sure if anyone can help me, I am working on a site for my university, and am having a bit of trouble with css positioning. I am very new to css and do not know very much about it....
14
by: Fistro | last post by:
I'm trying to find a design that would allow me to build web pages without having to worry about compatibility issues (not too much, in any case,,,) I've came across this CSS layout technique:...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.