我正在嘗試在全頁(yè) div 容器后進(jìn)行分頁(yè)。 就像加載一個(gè)介紹性頁(yè)面一樣,如果向下滾動(dòng),您可以進(jìn)入一種導(dǎo)航中心。 我覺得這可能是一個(gè) chrome 問題,但分頁(yè)符項(xiàng)目在 Edge 中也不起作用。
我想要在 <div class="pagebreak">
的關(guān)閉選項(xiàng)卡之后分頁(yè)。 div 包含一個(gè)背景、一個(gè)小標(biāo)題和一個(gè)大標(biāo)題,所有這些都填充(并且應(yīng)該填充)一個(gè)完整的頁(yè)面。之后,我想強(qiáng)制打開一個(gè)新頁(yè)面,這樣您就必須向下滾動(dòng),而與屏幕尺寸無(wú)關(guān)。
<body> <div> <div class="pagebreak"> <div class="nav"> <nav> <div class="navitem"> <a href="#webprogrammierung">Webprogrammierung</a> <a class="name">Niclas Kusenbach</a> <a href="#verteilteSysteme">Verteilte Systeme</a> </div> </nav> </div> <div class="container"> <div class="centered"> <h1>Mein Portfolio.</h1> <h2>Entwicklung verteilter Systeme</h2> </div> </div> </div> <div class="uebersicht"> <div id="webprogrammierung"> <h3>Webprogrammierung</h3> <a>Vorlesung 1</a> <a>Vorlesung 2</a> <a>Vorlesung 3</a> <a>Vorlesung 4</a> <a>Vorlesung 5</a> <a>Vorlesung 6</a> <a>Vorlesung 7</a> </div> <div id="verteilteSysteme"> <h3>Verteilte Systeme</h3> </div> </div> </div> </body>
.uebersicht { display: block; page-break-before: always; float: none; } .pagebreak { page-break-after: always; page-break-inside: avoid; }
我希望我理解正確,這個(gè)例子會(huì)對(duì)你有所幫助
試試這個(gè)CSS
html, body { width: 100%; height: 100%; margin: 0; } .wrapper { width: 100%; height: 100%; margin: 0; display: flex; flex-direction: column; } .first { width: 100%; background-color: red; flex: 0 0 100%; } .second { width: 100%; background-color: blue; flex: 0 0 100%; }
并嘗試這個(gè) html
Some picturessome content