Isikhundla
Sebenzisa ezi zixhobo zimfutshane ukuqwalasela ngokukhawuleza indawo yento.
Amaxabiso aqhelekileyo
Iiklasi zokubeka ngokukhawuleza ziyafumaneka, nangona zingaphenduli.
<div class="position-static">...</div>
<div class="position-relative">...</div>
<div class="position-absolute">...</div>
<div class="position-fixed">...</div>
<div class="position-sticky">...</div>
Umphezulu olungisiweyo
Beka into phezulu kwindawo yokujonga, ukusuka emphethweni ukuya emphethweni. Qiniseka ukuba uyayiqonda imilinganiselo yesikhundla esisisigxina kwiprojekthi yakho; unokufuna ukongeza i-CSS eyongezelelweyo.
<div class="fixed-top">...</div>
Fixed emazantsi
Misa into ezantsi kwendawo yokujonga, ukusuka emphethweni ukuya emphethweni. Qiniseka ukuba uyayiqonda imilinganiselo yesikhundla esisisigxina kwiprojekthi yakho; unokufuna ukongeza i-CSS eyongezelelweyo.
<div class="fixed-bottom">...</div>
Umphezulu oncangathi
Beka into phezulu kwindawo yokujonga, ukusuka emphethweni ukuya emphethweni, kodwa kuphela emva kokuba uskrole udlule kuyo. Isixhobo .sticky-top
sisebenzisa ii-CSS's position: sticky
, ezingaxhaswanga ngokupheleleyo kuzo zonke iibhrawuza.
IE11 kunye ne-IE10 ziya kwenza position: sticky
njenge position: relative
. Ngaloo ndlela, @supports
sisonga izitayile kumbuzo, sinciphisa ukuncamathela kuphela kwizikhangeli ezinokunikezela ngokufanelekileyo.
<div class="sticky-top">...</div>