Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a web page that a client would like to print, and the part I'm having trouble getting my head around is to get the footer to sit at the bottom of the last printed page, not just when the content ends

I tried something like

 #printfooter{display: block; position:fixed; bottom: 0;}

but it displayed the footer at the end of each page.

Maybe Im asking a bit too much from CSS... Is it doable?

I'm thinking I should just go crazy with <br />'s (^_^)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
351 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try to position the body relative and the footer absolute:

body {
    position: relative;
}
#printfooter {
    position: absolute;
    bottom: 0;
}

With CSS 3 Paged Media module you could use something like this:

@page:last {
    @bottom-center {
        content: "…";
    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...