views:

37

answers:

3

To make a short story long, I'm in charge of fixing all these CSS issues of Microsoft SP. One is the inability for the content to print in FireFox (a well known bug that Mozilla seems it won't address). So I have to create a stylesheet specifically for FireFox so the content can print.

I already fixed the issue and it prints fine. The problem I'm having now is that the footer won't stay at the bottom of the content since the content has position: absolute (one of the fixes for the FF print bug).

Here's (roughly) the HTML code:

<div id="ncs">
 <div class="ncs_content">
  <div class="ncs_stage">
   <div class="ncs_stage_top">
    <div class="ncs_stage_content">content...</div>
   </div>
  </div>
 </div>
 <div class="ncs_footer">turned off content</div>
 <div class="ncs_footer_printed_date">print date that needs to be displayed</div>
</div>

My CSS:

#ncs { border: none; width: 100%; height: 100%; float: none; background: none; }
.ncs_content { background: none; border: none; float: none; }
/* this fixes the FF bug */
.ncs_stage_content {
    float: none;
    overflow: visible !important;
    position: absolute;
    height: auto;
    width: 90%;
    font-size: 14px;
    padding: 20px 0px;
    margin: 10px 0px;
    font-size: 120%;
    clear: both;
    display: block;
}
.ncs_footer { clear: both; height: 100%; position: relative; }

.ncs_footer_printed_date {
    float: left; 
    display: block;
    width: 950px;
    position: relative;
    bottom: 0;
    left: 0;
    clear: both;
    height: 120%;
    vertical-align: bottom;
}

I got it to print the footer on every page, but that's not good enough. They want it to print at the bottom of the content.

I've been struggling with this for a few days now so any ideas would be greatly appreciated. I am really good at CSS but when it comes to stupid issues with things that Microsoft makes, it's really frustrating.

Thanks for any advice!!!

A: 

Pardon me if I misunderstood, but what about using absolute positioning for the footer?

cinqoTimo
I've tried that as well. It doesn't work. The footer still shows up at the top (actually it's cut off at the top).
Janny
A: 

What if you moved the footer inside the content div? It should position itself at the bottom of the page.. (I know that this would break the logical structure of the document, but if it saves you of lot of pain, all in all.. hey, who cares? ;-) ).

Absolute positioning the footer won't solve the problem, 'cause the two blocks' positions would still be independent

Lucius
I'd love to do it that way, but I don't think my boss wants it that way. I got it to go to the bottom of every page, but he wants it at the bottom of the content. Very picky.
Janny
I'm not sure I understand what you mean by 'page' and 'content', at this point.. can you post a little sketch or a link to an example?
Lucius
Well when I say page I mean printing page. The problem with FireFox is that the content cuts off after the first page (it's a bug with FF). Developers need to code around it and one of the ways is using the above code (position: absolute, overflow: visible, etc).
Janny
When I mean content, I mean what's actually being printed, the content of the page (in the ncs_stage_content div). I'm just having problems putting the stuff that's in the ncs_footer_printed_date div actually below the stuff that's in the ncs_stage_content. Even though they are positioned where they should be in XHTML, because of the absolute positioning, it's putting the ncs_footer_printed_date stuff above it. Does that make sense? I'm sorry if I'm not being clear.
Janny
If you set absolute positioning to #ncs instead of .ncs_stage_content, would the FF hack stop working?
Lucius
Yes, I already tried that too and it didn't work. The FF hack stopped working.
Janny
A: 

Wohoo! I figured it out!

Thanks for all your help. Here's my CSS to fix it:

ncs {

float: none;
overflow: visible !important;
position: absolute;
height: auto;
width: 99%;
font-size: 12px;
padding: 20px 0px;
margin: 10px 0px;
clear: both;

}

.ncs_content { background: none; border: none; float: none; }

.ncs_stage_content, .ncs_stage { margin: 0; padding: 0; float: none; clear: both; font-size: 12px; }

.ncs_footer { display: none; }

.ncs_footer_printed_date { margin: 0px; padding: 0px; width: 750px; font-size: 12px; display: block; }

So I basically had to encapsulate everything in #ncs (like what Lucius said) then play with it from there. I'll probably post this on my syntax notes site as well just in case if this thread gets removed... hopefully it'll help someone else struggling with the FF print bug.

Thanks to all! HURRAY! Now I will tell my boss... not that he cares how long it took or how many brain cells I killed by hitting my head against my desk...

Janny