"Footer" feem ntau yog qhov qis tshaj plaws-thaiv ntawm daim nplooj web. Qhov teeb meem feem ntau nyuaj rau muab tso rau hauv cov ntawv hauv qab no yog kom tau nws ib txwm muab tso rau hauv qab ntawm lub qhov rai, tsis hais txog nplooj ntawv tag nrho lossis browser hom. Muaj ntau ntau cov kev daws teeb meem rau qhov teeb meem txij li lub sijhawm ntawm kev hloov pauv loj heev los thaiv kev teeb tsa, thiab ib qho ntawm lawv tau muab hauv qab no.
Nws yog qhov tsim nyog
Kev paub yooj yim ntawm CSS thiab HTML
Cov Lus Qhia
Kauj ruam 1
Cia peb siv txoj kev teev cov nplooj ntawv ib txwm siv los ua lub hauv paus - peb ntu muab tso rau ib qho dhau ib qho. Sab saum toj (lub taub hau) yuav tsum tau txuas tas li mus rau sab saum toj ciam teb ntawm lub qhov rais, qhov hauv qab (hauv qab) - mus rau hauv qab ciam teb, thiab lub ntsiab (lub cev) yuav tsum nco ntsoov sau tag nrho cov chaw ntawm lawv. Lub hauv paus pib yuav tsum muaj qhov txuas mus rau XHTML 1.0 Kev Hloov Pauv Hloov Sij Hawm, thiab cov lus piav qhia ntawm cov qauv yuav tsum tau muab tso rau hauv lwm daim CSS (kom tsis txhob muaj teeb meem rau Opera 9. XX) Cov lus piav qhia HTML ntawm tus qauv yuav tsum muab tso rau hauv qhov tseem ceeb lub cev ntawm cov nplooj ntawv. Nws yuav pib, ntawm chav kawm, los ntawm cov khoom siv sab saum toj, hauv cov cim npe ntawm tus cim ntaus cim nrog tus nqi yuav tsum muab tso rau, piv txwv li, divHead:
Lub taub hau thaiv.
Lub ntsiab thaiv yuav tsum muaj ib khub ntawm cov pawg zes. Lub sab nraud yuav muab cov divOut cim, thiab sab hauv ib - divContent:
Cov ntsiab lus tseem ceeb.
Tus ntsuas ntawv pob yog teem rau divFoot:
Nplooj ntawv plaub hau.
Kauj ruam 2
Cov code HTML tag ntawm nplooj ntawv yuav tsum zoo li no:
Peb ntu
@import "style.css";
Nov yog kab hauv qab.
Cov ntsiab lus tseem ceeb.
Nov yog lub hauv paus ntawm nplooj ntawv.
Kauj ruam 3
Cov lus piav qhia style siv cov txheej txheem txheej txheej hauv qab no: nruab nrab thaiv (divOut) tau teeb tsa 100% qhov siab, qhov thaiv sab saum toj (divHead) yuav muaj qhov muab tso ncaj ncees, thiab hauv qab ib - txheeb ze. Hauv cov ntsiab lus tseem ceeb thaiv (divContent), yuav tsum muaj qhov chaw nyob ntawm qhov sib npaug ntawm qhov sib luag ntawm qhov siab ntawm lub taub hau thaiv kom nws tsis txhob hla cov ntsiab lus tseem ceeb ntawm nplooj ntawv. Thiab qhov hauv qab thaiv (ko taw) yuav tsum muaj qhov tsis zoo nyob rau saum toj, sib npaug nrog qhov siab ntawm qhov block. Qhov no yuav nce nws saum toj hauv qab ciam teb ntawm qhov browser. Tus txheej txheem no tuaj yeem ua tiav siv cov ntawv css nrog cov ntsiab lus hauv qab no: * {npoo: 0; padding: 0}
html, lub cev {qhov siab: 100%;} lub cev {
txoj hauj lwm: tus txheeb ze;
xim: # 000;
}
#divOut {
cov npoo: 0;
min-qhov siab: 100%;
tom qab: #FFF;
xim: # 000;
}
* html #divOut {qhov siab: 100%;}
#dab neeg {
txoj hauj lwm: txog;
sab laug: 0;
saum: 0;
dav: 100%;
qhov siab: 80px;
tom qab: # 2F5000;
txeej: muab zais;
text-align: chaw;
xim: #FFF;
} #divFoot {
txoj hauj lwm: tus txheeb ze;
ntshiab: ob qho tag nrho;
npoo-saum: -60px;
qhov siab: 60px;
dav: 100%;
xim tom qab: # 2F5000;
text-align: chaw;
xim: #FFF;
}
.divContent {
dav: 100%;
ntab: laug;
padding-saum: 81px;
} Lub npe koj teev rau hauv stylesheet hauv HTML code yog style.css.