Yuav ua li cas thiaj ua rau hauv ko taw feem ntawm nplooj ntawv ("ko taw") lo rau hauv qab ciam ntawm lub qhov rais - qhov no tej zaum qhov teeb meem feem ntau hauv cov qauv ntawm cov nplooj ntawv. Muaj, ntawm chav kawm, kev daws teeb meem, thiab muaj ob peb ntawm lawv. Hauv qab no yog ib txoj hauv kev kom paub tseeb tias tus taw taw ib txwm nias rau hauv qab ntawm nplooj ntawv, tsis hais tus nqi ntawm cov ntsiab lus thiab hom browser.
Nws yog qhov tsim nyog
Kev paub yooj yim ntawm CSS thiab HTML
Cov Lus Qhia
Kauj ruam 1
Cia peb ua ib qho ntawm cov qauv tshaj tawm pagination ua piv txwv - nws yuav muaj nthab (sau npe), thaiv lub ntsiab, thiab taw taw. Yog lawm, yog tias tsim nyog, koj tuaj yeem tso ob peb kab tawm rau hauv lub ntsiab thaiv, tab sis peb yuav tsis ua qhov no ntawm no, peb tsuas yog tsom mus rau tsis muab tso rau hauv qab xib taws. HTML code ntawm nplooj ntawv yuav pib nrog kev tshaj tawm ntawm cov kev qhia tshwj xeeb:
Nruab nrab ntawm cov ntawv cim npe thiab, ntxiv rau nplooj ntawv nplooj ntawv, peb yuav tso qhov cim ntawm qhov encoding: As Well as tau txuas rau ib daim CSS sab nraud uas muaj cov lus piav qhia txog hom: @import "styles.css"; Peb yuav tsis tso cov cov lus piav qhia txog cov qauv ncaj qha mus rau html-code ntawm nplooj ntawv kom tsis txhob muaj kev cuam tshuam nrog Opera browser ntawm cuaj version. Ntawm cov cim npe thiab tso cov qauv thaiv ntawm nplooj ntawv. Thawj, ntawm chav kawm, yog lub npe thaiv. Peb yuav muab nws cov ntawv cim taub hau yuav tuaj yeem tsim qauv rau qhov thaiv tshwj xeeb:
Cov header no ib txwm nyob rau saum toj ntawm lub qhov rais.
Tom qab ntawd - lub ntsiab thaiv ntawm nplooj ntawv. Nws yuav muaj ob qhov zes - cov sab nraud (tus cim sab nraud - sab nraud) thiab sab hauv (tus cim (lub cim - sab nraud)):
Nov yog qhov tseem ceeb.
Thiab thaum kawg, tus taw:
Nws yog footer - ib txwm nyob hauv qab ntawm lub qhov rais!
Phab ntawv tag yuav zoo li no:
Yuav ua li cas nias cia rau ntawm lub footer
@import "styles.css";
Cov header no ib txwm nyob rau saum toj ntawm lub qhov rais.
Nov yog qhov tseem ceeb.
Nws yog footer - ib txwm nyob hauv qab ntawm lub qhov rais!
Kauj ruam 2
Tam sim no cia peb txav mus rau cov ntsiab lus ntawm cov stylesheet. Nws siv cov txheej txheem hauv qab no: lub ntsiab nplooj ntawv lub ntsiab yuav raug teeb tsa kom 100% qhov siab, lub npe yuav raug tso rau qhov chaw kiag, thiab hauv qab xib taws kuj yuav raug. Txhawm rau tiv thaiv nqe lus los ntawm kev sib tshooj cov ntsiab lus ntawm nplooj ntawv, cov ntsiab lus tseem ceeb no tau muab tso rau hauv ib lub thawv ntxiv hauv lub npov tseem ceeb, thiab lub npov ntxiv no tau tsim rau cov npoo saum toj kawg nkaus sib npaug nrog rau qhov siab ntawm lub taub hau. Thiab tus taw yog muab lub ntsiab lus tsis zoo sab saum toj sib npaug zos rau nws qhov siab - nyob rau hauv txoj kev no nws yuav raug tsa siab saum toj kawg nkaus ntawm lub qhov rais rau nws qhov siab tag nrho. Cov ntsiab lus tag nrho ntawm cov ntawv css: * {npoo: 0; padding: 0}
html, lub cev {qhov siab: 100%;} lub cev {
xim: dub;
txoj hauj lwm: tus txheeb ze;
}
#outer {
min-qhov siab: 100%;
cov npoo: 0;
tom qab: dawb;
xim: dub;
} * html #outer {qhov siab: 100%;}
#head {
txoj hauj lwm: txog;
saum: 0;
sab laug: 0;
dav: 100%;
qhov siab: 70px;
tom qab: # 304a00;
txeej: muab zais;
xim: dawb;
text-align: chaw;
} #footer {
txoj hauj lwm: tus txheeb ze;
npoo-saum: -50px;
ntshiab: ob qho tag nrho;
dav: 100%;
qhov siab: 50px;
xim tom qab: # 304a00;
xim: dawb;
text-align: chaw;
}
.outerwrap {
ntab: laug;
dav: 100%;
padding-saum: 71px;
} Cov ntaub ntawv no yuav tsum muab khaws cia nrog lub npe uas peb teev hauv qhov html-code ntawm nplooj ntawv - styles.css.