我正在使用html2pdf库: html2pdf.fr/en/default 和我'm having issues with the alignment of an element on a random page. In the latest version it went wrong on page 5. I validated the HTML source and there weren' t任何错误 . 我发布了一个简短的片段,因为我没有相关的内容.2990786_如果需要,我可以发布整个HTML . 提前致谢!

第4页(它的方式)

enter image description here

第5页

enter image description here

编辑:这是HTML和CSS代码

<style>
.body {
    font-family:'Verdana', 'Geneva', 'Arial', 'Helvetica', sans-serif;
    font-size:11px;
    background-repeat:no-repeat;
    width:768px;
    height:1086px;
    margin-top:-150px;
}
.address {
    position:absolute;
    top:200px;
    left:20px;
    width:200px;

    font-size:11px;
    line-height:15px;
}
.logo {
    position:absolute;
    top:37px;
    left:0;
    width:768px;
    height:56px;
}
.date {
    position:absolute;
    top:330px;
    left:20px;

    font-size:11px;
    line-height:15px;
}
.date2 {
    position:absolute;
    top:130px;
    left:20px;
}
.page {
    position:absolute;
    top:380px;
    left:20px;

    font-size:11px;
    line-height:15px;
}
.page2 {
    position:absolute;
    top:180px;
    left:20px;
}
.h1 {
    width:480px;
    text-align:right;
    margin-top:0;
    margin-bottom:70px;

    font-size:14px;
    font-weight:normal;
    display:block;
}
.section {
    position:absolute;
    top:50px;
    left:260px;
    width:480px;
}
.second .section {
    top:150px;
}
h2 {
    font-size:14px;
    font-weight:bold;
    margin-top:40px;
    margin-bottom:0px;
    padding-bottom:5px;
}
.h5 {
    font-size:14px;
}
ul li {
    padding-top:20px;

    font-size:12px;
    line-height:16px;
}
p { 
    font-size:12px;
    line-height:16px;
}
</style>
<page backtop="150px">
<div class="body" style="background-image:url(/var/www/skills-assessment_tue_nl/images_ond/wm_96dpi.png);">

    <page_header>
        <div class="logo" style="background-image:url(/var/www/skills-assessment_tue_nl/images_ond/wm2_96dpi.png);">&nbsp;</div>
        <div class="address">
            <strong>Onderwijs en Studenten Service Centrum</strong><br><br>
            Den Dolech 2, 5612 AZ Eindhoven<br>
            Postbus 513, 5600 MB Eindhoven<br>
            Intern adres: MetaForum MF 1.136<br>
            www.tue.nl
        </div>

        <div class="date">
            <strong>Date</strong><br>
            07-12-2015          </div>

        <div class="page">
            <strong>Page</strong><br>
            [[page_cu]] of [[page_nb]]
        </div>

    </page_header>

    <div class="section" style="page-break-after: always;">
        <div class="h1">Report  In-depth test on Teamwork Skills</div>

        <h2>Your test results on  In-depth test on Teamwork Skills</h2>
        <p>Based on your Self Assessment your current level on  In-depth test on Teamwork Skills is: level 1</p>
        <p>You need to improve your teamwork skills urgently. If you want to be effective in a team, you must learn how to communicate with your team members and how to honor agreements. Now is the time to start developing these skills to increase both your team&rsquo;s and your personal success. Use TU/e Skillslab for tips and tools to improve your teamwork skills.</p>            
        <p>In this report you can find your skill level and sub-skill levels based on the self-assessment you have completed. The levels range from 1 to 5:</p>
        <ul style="list-style-type:none;">
            <li style="margin:0;padding:1px;">1 = weak</li>
            <li style="margin:0;padding:1px;">2 = moderate</li>
            <li style="margin:0;padding:1px;">3 = reasonable</li>
            <li style="margin:0;padding:1px;">4 = strong</li>
            <li style="margin:0;padding:1px;">5 = excellent</li>
        </ul>

        <h2>Your level for each sub-skill</h2>
        <p>Based on your Self Assessment your current level on</p>

        <ul>
            <li>
                <em>1. Active Listening</em> is: level 1<br>
                <p>You seldom hear what the group is talking about and you are not able to summarize it. Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to work on your <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=4">active listening</a>&nbsp;skills.</p>
            </li>
            <li>
                <em>2. Communication</em> is: level 1<br>
                <p>You hardly communicate with team members on opinions and progress. You are not able to formulate the essence of your idea or answer critical questions. For good teamwork this is essential and therefore it needs to improve.&nbsp;Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to work on your <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=5">communication</a>&nbsp;skills.</p>
            </li>
            <li>
                <em>3. Providing and receiving feedback</em> is: level 1<br>
                <p><strong>Receiving feedback</strong>
You react to feedback with anger or indifference. Try to accept feedback as a gift that you can use to improve the quality of your work.</p> <p><strong>Providing feedback</strong>
You hardly provide constructive feedback on the behavior or work from team members. And if you do, you don&rsquo;t follow the feedback rules. Remember that the group benefits from your feedback if you formulate is correctly.&nbsp;</p> <p>Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to work on your <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=6">feedback</a>&nbsp;skills.</p> </li> <li> <em>4. Different roles</em> is: level 1<br> <p>Your ability to perform a range of roles during a meeting is low. You need to improve this skill urgently, you must learn how to take on different roles. Now it is time to start developing these skills to increase your success.&nbsp;Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to work on your <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=7">different roles</a>&nbsp;skills.</p> </li> <li> <em>5. Collaboration</em> is: level 1<br> <p>It is clear, you don&rsquo;t enjoy working in a team and you don&rsquo;t see the benefits. However, there are benefits from working in a team. Perhaps you find it difficult to express yourself in a group.&nbsp;Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to work on your <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=8">collaboration</a>&nbsp;skills.</p> </li> <li> <em>6. Taking responsibility</em> is: level 1<br> <p>You find it hard to honor agreements and taking responsibility. This could be caused by different things like starting too late with assigned tasks, underestimate the work involved, etc. However, you need to change this behavior urgently. If you want to be successful you must learn how to organize and monitor your own work.&nbsp;Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to work on your <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=9">responsibility</a>&nbsp;skills.</p> </li> <li> <em>7. Standing up for yourself</em> is: level 1<br> <p>You are unable to independently take your position.&nbsp;Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to learn to <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=10">stand up for yourself</a>.</p> </li> <li> <em>8. Participation in meetings&amp;discussions</em> is: level 1<br> <p>You are not visible during meetings and discussions, you like to keep a low profile. This maybe caused by the fact that you seldom prepare for a meeting or discussion and that you don&rsquo;t know what you would like to say during the meeting, so you just say nothing. In order to be successful you need to change this behavior.&nbsp;Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to work on your <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=11">meetings and discussions</a>&nbsp;skills.</p> </li> <li> <em>9. Problem solving</em> is: level 1<br> <p>You probably tend to view problems as negatives, instead of seeing them as opportunities to make exciting and necessary change. Your approach to problem solving is to let others solve it. Telling others about problems you encounter is something you don&rsquo;t do.&nbsp;Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to work on your <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=12">problem solving</a>&nbsp;skills.</p> </li> <li> <em>10. Dealing with conflicts</em> is: level 1<br> <p>You tend to avoid conflicts in your team. Most of the time, a conflict does not dissolve by just avoiding it. It actually makes it worse in the long term in many cases. Also, bear in mind that in some cases conflicts can be very fruitful and bring your team on a higher level.&nbsp;Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to work on your <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=13">dealing with conflict</a>&nbsp;skills.</p> </li> <li> <em>11. Decision making</em> is: level 1<br> <p>Your decision-making hasn't fully matured. You rely too much on luck, instinct or timing to make reliable decisions. Start to improve your decision-making skills by focusing more on the process that leads to the decision, rather than on the decision itself. With a solid process, you can face any decision with confidence.&nbsp;Go to the <a href="https://www.tueskillslab.nl/C349-TUe-SkillsLab.html">TU/e SkillsLab</a>&nbsp;to work on your <a href="https://www.tueskillslab.nl/skillslab.php?nav=341&amp;skill=2&amp;subskill=14">decision making</a>&nbsp;skills.</p> </li> </ul> <h3 style="margin-top:100px;">Appendix</h3> <div> <p class="h5">Introduction Teamwork Skills</p> <ul> <li> <strong>The last time I worked in a team, we worked together on:</strong><br> test </li> <li> <strong>The last time I worked in a team, the team was made up of the following people/roles:</strong><br> test </li> <li> <strong>The last time I worked in a team, this is what went well:</strong><br> test </li> <li> <strong>The last time I worked in a team, this is what could have been better:</strong><br> test </li> <li> <strong>I benefit most from these tips/exercises/etc. on teamwork:</strong><br> test </li> <li> <strong>1.7&nbsp;Who is your role model for this skill?&nbsp;Think of someone who collaborates&nbsp;extremely well, inside or outside of the university.</strong><br> test </li> <li> <strong>What does this person&nbsp;do that makes them a role model?</strong><br> test </li> <li> <strong>1.9&nbsp;Let&rsquo;s say this person&nbsp;scores a 10 on teamwork skills. Compared to this person, how would you rate your teamwork&nbsp;skills?</strong><br> test </li> </ul> <p class="h5">1. Active Listening</p> <ul> <li> <strong>1.1 What aspects do you think that are important in listening to your team members? Name at least three.&nbsp;</strong><br> test </li> <li> <strong>1.2 When do you have the feeling that the other members of the team actively listen to what you say? And when not?</strong><br> test </li> </ul> <p class="h5">2. Communication</p> <ul> <li> <strong>2.1 In the last team you worked in, about what things (work related) did you and your team communicate?</strong><br> test </li> <li> <strong>2.2 Were there topics that you did not talk about, which you think you should have talked about?&nbsp;</strong><br> test </li> </ul> <p class="h5">3. Providing and receiving feedback</p> <ul> <li> <strong>3.1 When was the last time you exchanged feedback with fellow students?&nbsp;</strong><br> test </li> <li> <strong>3.2 What was the most important&nbsp;feedback you received?</strong><br> test </li> </ul> <p class="h5">4. Different roles</p> <ul> <li> <strong>4.1 In the last team you worked in, what role did you fulfill?&nbsp;</strong><br> test </li> <li> <strong>4.2 What did you enjoy and what did you not enjoy about this role?</strong><br> test </li> </ul> <p class="h5">5. Collaboration</p> <ul> <li> <strong>5.1 Think of&nbsp;the last team you worked with. When was the atmosphere at best and when was it at worst?</strong><br> test </li> <li> <strong>5.2 What do you think caused the good or bad atmosphere within your team?</strong><br> test </li> </ul> <p class="h5">6. Taking responsibility</p> <ul> <li> <strong>6.1 In the last team you worked in, what were the team agreements?</strong><br> test </li> <li> <strong>6.2 What was your responsibility within that team?</strong><br> test </li> </ul> <p class="h5">7. Standing up for yourself</p> <ul> <li> <strong>7.1 In the last team you worked in, did you have the feeling that you could share your opinion?</strong><br> test </li> <li> <strong>7.2 How did you share your opinion?</strong><br> test </li> </ul> <p class="h5">8. Participation in meetings&amp;discussions</p> <ul> <li> <strong>8.1 When would you think of a meeting as effective or successful?&nbsp;</strong><br> test </li> <li> <strong>8.2 How do you prepare for a meeting?</strong><br> test </li> </ul> <p class="h5">9. Problem solving</p> <ul> <li> <strong>9.1 In your last team work, did you have to deal with any problems or difficulties?</strong><br> test </li> <li> <strong>9.2 What was your contribution in solving this problem?</strong><br> test </li> </ul> <p class="h5">10. Dealing with conflicts</p> <ul> <li> <strong>10.1 Have you ever had to deal with conflicts within a team?</strong><br> test </li> <li> <strong>10.2 What needed to happen for this conflict to be solved?</strong><br> test </li> </ul> <p class="h5">11. Decision making</p> <ul> <li> <strong>11.1 In your last team work, what was the most important or difficult decision that had to be made?</strong><br> test </li> <li> <strong>11.2 What method did you use to make this decision?</strong><br> test </li> </ul> </div> </div> </div> </page> try { $sFileName = strtolower(str_replace(array(' ', ','), '_', $sTitle . '.pdf'; $oPDF = new HTML2PDF('P', 'A4', 'nl', true, 'UTF-8', 3); $oPDF->pdf->SetDisplayMode('fullpage'); $oPDF->setDefaultFont('Helvetica'); $oPDF->writeHTML($sContent); $oPDF->Output(UPLOAD_PATH . 'docs/' . $sFileName, 'F'); } catch(HTML2PDF_exception $e) { echo $e; exit; }