Yuav Ua Li Cas Thawb Footer Rau Hauv Qab

Cov txheej txheem:

Yuav Ua Li Cas Thawb Footer Rau Hauv Qab
Yuav Ua Li Cas Thawb Footer Rau Hauv Qab

Video: Yuav Ua Li Cas Thawb Footer Rau Hauv Qab

Video: Yuav Ua Li Cas Thawb Footer Rau Hauv Qab
Video: Tsis Muaj Peev Xwm Yuav Ua Li Cas 2024, Hlis ntuj nqeg
Anonim

Qhov hauv qab-feem ntau kab thaiv ntawm ib nplooj ntawv nplooj feem ntau hu ua "footer". Hauv nws, zoo li hauv lwm cov nplooj ntawv, tsim cov khoom tsim tau muab tso, tab sis tsis zoo li lwm tus, cov teeb meem tshwj xeeb feem ntau tshwm sim nrog kev tso chaw ntawm lub block tshwj xeeb. Lawv tau txuas nrog qhov tseeb tias browser sib txawv to taub cov qauv ntawm CSS yam lus sib txawv thiab nws tuaj yeem nyuaj heev kom tau txais hauv qab mus rau hauv qab ntawm qhov browser browser. Hauv qab no yog cov cai rau ib qho ntawm cov kev daws teeb meem no.

Yuav ua li cas thawb footer rau hauv qab
Yuav ua li cas thawb footer rau hauv qab

Tsim nyog

Kev paub yooj yim ntawm CSS thiab HTML

Cov Lus Qhia

Kauj ruam 1

Hauv thawj kab xub thawj ntawm nplooj ntawv tso tawm qhov chaw, tso cov lus siv rau XHTML 1.0 Kev Hloov Chaw:

Kauj ruam 2

Tso cov khoom loj ntawm nplooj qauv hauv sab hauv lub cev ntawm daim ntawv (nruab nrab ntawm thiab cov cim npe). Qhov thaiv uas cov ntsiab lus tseem ceeb yuav muab tso rau yuav tsum muaj ob txheej txheej ua zes. Piv txwv li, cia sab nraud ib qho muaj tus cim OuterDiv, thiab sab hauv ib - InnerDiv:

Nov yog qhov twg lub ntsiab lus tseem ceeb ntawm nplooj ntawv.

Qab rau lawv tso cov ntawv pov ntawv hauv qab nrog tus cim, piv txwv li, FooterDiv:

Hauv qab ntawm nplooj.

Kauj ruam 3

Muab nyob rau hauv lub taub hau ib feem ntawm HTML code (nruab nrab ntawm thiab lub cim npe) ib qhov txuas rau ib daim ntawv sab nraud nrog cov lus piav qhia ntawm css styles:

@import "footerStyle.css";

Kauj ruam 4

Txuag tag ua tiav nplooj ntawv nplooj ntawv rau ib daim ntawv nrog txuas ntxiv html. Nws zoo li qhov no:

Nias footer

@import "footerStyle.css";

Nov yog qhov twg lub ntsiab lus tseem ceeb ntawm nplooj ntawv.

Hauv qab ntawm nplooj.

Kauj ruam 5

Tsim cov ntawv stylesheet - cov ntawv sau ua cov ntawv uas yuav tsum tau khaws nrog css txuas ntxiv thiab lub npe koj teev hauv cov HTML code (footerStyle.css). Sau rau cov ntawv no cov lus piav qhia txog cov qauv siv rau nplooj ntawv:

* {npoo: 0; padding: 0}

html, lub cev {qhov siab: 100%;}

lub cev {

txoj hauj lwm: tus txheeb ze;

xim: # 222222;

}

#OuterDiv {

cov npoo: 0;

min-qhov siab: 100%;

tom qab: #aaaaaa;

xim: # 222222;

}

* html #OuterDiv {qhov siab: 100%;}

#FooterDiv {

txoj hauj lwm: tus txheeb ze;

ntshiab: ob qho tag nrho;

npoo-saum: -60px;

qhov siab: 60px;

dav: 100%;

xim tom qab: DarkBlue;

text-align: chaw;

xim: #eeeeff;

}

. XyijDiv {

dav: 100%;

ntab: laug;

}

Pom zoo: