Ib txoj hauv kev los ntxig rau ib nplooj ntawv rau nplooj ntawv yog siv cov HyperText Markup Language (HTML) muaj peev xwm los faib nplooj ntawv rau hauv cov qhov rais cais. Xws li lub qhov rais hu ua "ntas" thiab tuaj yeem muaj ob peb ntawm ib nplooj ntawv. Txhua tus ncej, nyeg, nws tus kheej yuav muaj cov txheej txheem ntas, thiab txhua ntawm lawv tuaj yeem thauj khoom nrog nplooj ntawv los ntawm ntau qhov chaw.
Nws yog qhov tsim nyog
Phau ntawv editor Notepad
Cov Lus Qhia
Kauj ruam 1
Txhawm rau tsim cov txheej txheem ntawm nplooj ntawv hauv nplooj ntawv, koj pib los ntawm kev tsim lub thawv rau thav ntawv. Cov kev qhia rau browser kom tsim tau cov thawv ntawd hauv HTML zoo li qhov no:
Cov lus qhia zoo li no hu ua "cim npe". Cov no yog cov lus qhib thiab kaw lub thawv ntawm lub thawv, nruab nrab ntawm cov cim twg yuav tsum tau muab tso rau los ua tus thav ntawv. Cov cim npe muaj ntau cov ntaub ntawv ntxiv hu ua "cov cwj pwm" ntawm cov cim npe. Hauv kev qhib cim npe, koj yuav tsum tau qhia meej npaum li cas ntawm nplooj ntawv nplooj ntawv yuav tsum muab faib nruab nrab ntawm cov thav ntawv:
Ntawm no, cov cwj pwm "cols" qhia tias nplooj ntawv ntawm ob lub thav ntawv yuav tsum tau muab faib ua ib ntsug, muab txhua 50% ntawm lub qhov rais dav. Txhawm rau faib cov nplooj ntawv tav toj, lwm tus cwj pwm yog siv, "kab":
Tib yam tuaj yeem sau rau hauv no txoj kev:
Ntawm no, lub cim (*) qhia tias txhua qhov chaw seem yuav tsum tau muab rau tus ncej thib ob. Koj tuaj yeem qhia qhov tseem ceeb tsis nyob rau feem pua, tab sis "pixels" - qhov no yog chav ntsuas tseem ceeb ntawm kev ntsuas siv nyob rau nplooj ntawv:
Kauj ruam 2
Peb tau hais txog lub thawv ntim, tam sim no peb yuav tsum sau tus ncej lawv tus kheej. Daim HTML tag rau hauv nws daim ntawv yooj yim zoo nkaus li zoo li no: Ntawm no "src" cwj pwm qhia qhov chaw nyob Is Taws Nem ntawm nplooj ntawv uas yuav tsum thau rau hauv tus ncej no. Yog hais tias nplooj ntawv nyob rau ntawm tib lub server thiab hauv tib lub nplaub tshev (lossis subfolder), ces nws tsis tas yuav qhia qhov chaw nyob tag nrho, cov ntaub ntawv npe thiab cov kev mus rau lub subfolder tau txaus. Cov chaw nyob zoo li hu ua "tus txheeb ze", thiab cov chaw nyob tag nrho yog hu ua "tus tsis muaj". Cov tib daim ntawv nrog cov chaw nyob ntawm nplooj ntawv rau kev thauj khoom: - Siv cov khoom "scrolling", koj tuaj yeem teeb tsa cov cai rau kos duab ntawm kab ntawv no: Tus nqi "yog" txhais tau tias cov thav duab no yuav ib txwm muaj npe nrawm. Yog tias koj ntxig tus nqi "tsis muaj" - lawv yuav tsis muaj, thiab tus nqi "pib" txiav txim siab tias cov ntawv pov tseg yuav tshwm sim raws li xav tau yog tias cov ntsiab lus ntawm lub thav duab tsis haum rau nws cov ciam teb - Los ntawm lub neej ntawd, cov ciam teb ntawm cov thav ntawv hauv nplooj ntawv tuaj yeem txav nrog nas. Tab sis yog tias koj tau tsim lub noresize attribute rau daim pib, tom qab ntawd cov yam ntxwv no yuav raug xiam oob khab: - Lub thav duab kab ntawv muaj ob qho kev sib tw uas tsim cov npoo ntawm cov thav duab uas nyob ib sab - cov kab paj taub qhia qhov loj me ntawm cov npoo los ntawm cov npoo uas nyob ib sab horizontally (sab laug thiab sab xis), marginheight - ntsug (hauv qab thiab saum toj): - Lwm tus cwj pwm - lub npe - muab nws lub npe rau tus ncej. Qhov no tuaj yeem xav tau yog tias cov thav ntawv muaj cov ntawv sau uas yuav tsum ua ib yam dab tsi hauv cov thav duab uas nyob ib sab thiab paub qhov txawv ntawm cov npe:
Kauj ruam 3
Qhov theoretical tom qab no txaus los tsim ib nplooj ntawv yooj yim uas muaj, piv txwv li, ob nplooj ntawv los ntawm lwm qhov chaw. Cov kws kho kab lus yooj yim yuav txaus rau koj - tus qauv notepad zoo. Tsim daim ntawv tshiab thiab sau cov html code hauv qab no rau hauv nws:
Tam sim no khaws koj cov ntaub ntawv nrog qhov nthuav dav html - piv txwv li, test.html Tom qab ntawv, xyuas ob npaug ntawm test.html ntawv yuav tawm browser, thiab browser yuav tua cov lus qhia uas koj tau sau rau nws hauv html-code. Qhov tshwm sim yuav tsum zoo li no: