Cov nplooj ntawv feem ntau niaj hnub no tau nteg siv cov khaubncaws sab nraud povtseg (div), yog li qhov teebmeem ntawm kev teeb tsa lub tsev kawm ntawv mus rau hauv nruab nrab ntawm lub browser qhov rai raug txo qis rau kev ua haujlwm ntawm nruab nrab txheej uas txiav txim siab qhov dav ntawm thaj chaw pom ntawm nplooj ntawv. Txhawm rau kom nws muab tso rau qhov nruab nrab ntawm lub qhov rais, nws yog qhov tsim nyog los tsim cov kev teeb tsa uas tsim nyog rau nws niam txiv keeb, lossis rau qhov block no nws tus kheej.
Nws yog qhov tsim nyog
Cov txuj ci yooj yim ntawm HTML thiab CSS hom lus
Cov Lus Qhia
Kauj ruam 1
Tso cov txheej uas koj xav tso rau hauv nruab nrab ntawm lub qhov rais, nruab nrab ntawm qhov qhib thiab kaw qhov chaw ntawm lub chaw cim npe, yog tias koj xav tsuas yog siv cov kev txhais ntawm cov lus HTML (HyperText Markup Language - "hypertext markup language") Cov. Peb yuav xav tias tus niam txiv ntawm cov txheej uas txhais cov nplooj ntawv ciam yog lub cev ntawm nplooj ntawv no. Cov lus yooj yim tshaj plaws ntawm cov cai HTML siv cov chaw nruab nrab hauv cov ntawv no yuav zoo li no:
Cov nplooj ntawv nruab nrab
nplooj ntawv nyeem
Kauj ruam 2
Yog tias koj xav siv CSS (Cascading Style Sheets) rau nruab nrab kab ntawv ntawm nplooj ntawv, siv nws pib qhov loj ntawm cov padding los ntawm cov ciam teb ntawm qhov browser. Cov npoo qhov ntau thiab tsawg hauv CSS yog txiav txim siab los ntawm cov kab npoo. Tshem tawm cov chaw cim npe ntawm daim qauv dhau los thiab ntxiv cov npoo kab ntawm 0 pib rau cov qauv cwj pwm ntawm cov txheej uas txhais cov nplooj ntawv dav:
Cov nplooj ntawv nruab nrab
nplooj ntawv nyeem
Kauj ruam 3
Tau kawg, cov ntsiab lus txhais tau coj tawm ntawm cov cwj pwm style thiab muab tso rau hauv cov ntaub ntawv sab nraud lossis hauv lub taub hau ntawm cov ntaub ntawv (ntawm cov thiab cov cim npe). Hauv qhov no, tib qho cai yuav zoo li no:
Cov nplooj ntawv nruab nrab
#pomFrame {
dav: 700px;
qhov siab: 400px;
tom qab: # 0BB;
paj tau paj: 0 auto;
}
nplooj ntawv nyeem