Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
14 Trả lời
46847 Lượt xem

Hi guys

What is the correct way to create a div that is always showed on the bottom of the page?
I want to have a div print some text that is always right above the (custom) footer.
See this example:


Could anybody tell me the correct way to do this?
An example that I tried:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_saleorder_document">
    <t t-call="report.external_layout">
        <div class="page">
            <div class="oe_structure"/>
            <div class="row">
<!--Lots of irrelevant code for this question -->
<div class="oe_structure"/>
       <div style="float:bottom;width:100%;height:50px;bottom:0;">
        <p>
        Custom content right above footer
        </p>
    </div>
</div>
    </t>
</template>

I've been trying with float:bottom etc but its not giving what I want. So  is there anything custom built-in for this in QWeb?

Ảnh đại diện
Huỷ bỏ

Why can't you include your "custom content right above the footer" in the footer?

Tác giả

Because we already have a rather big footer and they don't want the footer to be higher. Plus the horizontal line would be above the text and the font should be different too.. So its something I'd rather not do / I'm not really allowed.

Tác giả

And I'm ofcourse curious about how to do this for future reports I might need to make. There are more times/options where you can use this :)

did you get any solution; i am facing the same issue

Have you find any solution for this?

Any solution over this ??????????????????????, I am facing same issues

Câu trả lời hay nhất

 Hello,

I Think it's helpful for you. 

<div style="position:absolute;top:850px; page-break-inside: avoid;">
     Your Custom Content
</div>

Thanks.

Ảnh đại diện
Huỷ bỏ

Your solution works, but the problem is because of the position absolute, the custom content can overlap with the page content

Câu trả lời hay nhất

   Try this code after <div class="page">... </div>

<div class="footer text-center">
            This is the footer
</div>

Ảnh đại diện
Huỷ bỏ
Tác giả

@Sajin thanks for the reply and method but sadly this will overwrite the default footer. I've already added a custom footer so I can't use this option :s I really need the content to be right above the footer.

@yenthe :- Did u got any solution?? I am also facing the same problem.

Tác giả

@pks nothing would do exactly what I wanted so I decided to take a slightly other approach and just make a hardcoaded div.

Hello ! I try to make a custom footer ... Can you show your code to see how you did it ? :-)

Câu trả lời hay nhất
 <div style="position:absolute; bottom:-xxpx;" >
my custom content
</div>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

If you just want it floating above your current footer, you can create a new class in css, add bottom: xx px; also you can add some transparency and hover to reduce or increase transparency. if you don't want cause any obstructions to see the page content ...

there is a many ways to solve this problem.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 24
5194
4
thg 1 25
44543
0
thg 10 24
1447
0
thg 10 24
5
1
thg 5 23
2987