Yuav Ua Li Cas Rau Nruab Nrab Ntawm Div

Cov txheej txheem:

Yuav Ua Li Cas Rau Nruab Nrab Ntawm Div
Yuav Ua Li Cas Rau Nruab Nrab Ntawm Div

Video: Yuav Ua Li Cas Rau Nruab Nrab Ntawm Div

Video: Yuav Ua Li Cas Rau Nruab Nrab Ntawm Div
Video: Qhia thaj poj niam hnov zoo nyob tshaj nplaw 2024, Kaum ib hlis
Anonim

Cov txheej txheem nplooj ntawv niaj hnub tsis txwv tsis pub siv cov txheej txheem rooj, txawm li cas los xij, txheej txheem txheej txheej, qhov tseeb, tau dhau los ua tus qauv kev cai thaum tsim cov chaw. Ntxiv nrog rau qhov pom tseeb zoo, qhov kev pabcuam ntawm lub rooj teeb tsa tau coj qee cov teeb meem tshiab loj thiab me. Ib ntawm lawv yog kab rov tav nrawm ntawm cov qauv thaiv hauv nplooj. Cia peb pom ob peb txoj hauv kev ua tau teem txheej txheej rau nruab nrab ntawm nplooj ntawv tuab.

Yuav ua li cas rau nruab nrab ntawm div
Yuav ua li cas rau nruab nrab ntawm div

Tsim nyog

Kev paub yooj yim ntawm HTML

Cov Lus Qhia

Kauj ruam 1

Ib qho ntawm cov kev xaiv daws teeb meem ntawm kev teeb tsa ib txheej (DIV block) mus rau nruab nrab ntawm lub qhov rai ntawm nplooj ntawv qhib yog hla dhau los tsuas yog siv cov HTML (HyperText Markup Language - "hypertext markup language"). Koj yuav tsum muab tso rau hauv lub thaiv. Cov nplooj ntawv yooj yim tshaj plaws, muab tso tawm ntawm txoj kev no, tuaj yeem saib, piv txwv, zoo li no:

Dlhos cov ntawv DIV rau nruab nrab

Kauj ruam 2

Lwm qhov kev xaiv siv CSS (Cascading Style Sheets). Nyob rau hauv cov qauv ntawm cov txheej txheej, koj yuav tsum teeb tsa lub txheej txheem ntawm qhov txiav tawm ntawm cov nyiaj ntawm offset los ntawm lub qhov rai ciam teb. Cov cai ntawm cov nplooj ntawv zoo li ntawd hauv nws daim ntawv yooj yim tshaj plaws yuav yog, piv txwv li, zoo li no:

Dlhos cov ntawv DIV rau nruab nrab

Pom zoo: