Hypertext Markup Language (HTML) muab lub peev xwm los faib nplooj ntawv ua ob peb lub qhov rais - "ntas". Txhua tus thav ntawv tuaj yeem muaj nws tus kheej internet los tso tawm. Cov txheej txheem no tuaj yeem siv los ntxig cov nplooj ntawv los ntawm lwm qhov chaw rau hauv nplooj ntawv los ntawm koj lub xaib.
Nws yog qhov tsim nyog
Phau ntawv editor Notepad
Cov Lus Qhia
Kauj ruam 1
Cov HTML code ntawm nplooj ntawv yog ib co kev qhia rau browser qhia qhov twg ntawm nplooj ntawv txhua ntawm nws lub ntsiab yuav tsum tso tawm kom pom thiab nws yuav saib zoo li cas. Cov lus qhia no yog hu ua "cim npe" thiab los tsim nplooj ntawv uas muaj ib lossis ntau dua lwm tus, koj yuav tsum sau cov ntawv tsim nyog ntawm cov cim npe. Peb pib nrog cov cim npe uas tsim ntim rau tag nrho cov thav ntawv ntawm nplooj ntawv:
Cov no yog cov qhib thiab kaw cov thawv ntawm lub ntim - cov cim npe uas tsim cov thav ntawv yuav xav tau tso rau nruab nrab ntawm lawv. Hauv HTML, cov ntawv cim npe muaj "tus cwj pwm" - lawv muaj cov ntaub ntawv ntxiv ntsig txog cov yam ntxwv ntawm nplooj ntawv, cov zaub uas qhia txog qhov cim no. Hauv qhov qhib daim pib ntawm lub thawv, koj yuav tsum qhia meej txog cwj pwm uas muaj cov ntaub ntawv hais txog yuav ua li cas browser yuav tsum faib cov nplooj ntawv chaw ntawm nws cov thav ntawv:
Qhov "cols" ntaus nqi hauv qhov qauv coj ua no tau qhia meej tias cov nplooj ntawv yuav tsum tau muab faib ua ib qho kab rov tav ua ob kab, nrog rau qhov seem yuav coj 20% ntawm lub qhov rais dav thiab txoj cai ib 80%. Yog hais tias hloov chaw ntawm "cols" attribute koj hais kom meej cov "kab" attribute, ces nplooj ntawv yuav tau muab faib ua ntej:
Hloov tus lej, koj tuaj yeem sau cov cim hnub qub (*):
Qhov no txhais tau hais tias lub thav duab thib ob yuav raug muab rau txhua qhov chaw seem ntxiv. Cov thav duab loj npaum li cas tuaj yeem teev tsis yog feem pua, tab sis hauv cov ntsuas ntawm kev ntsuas uas feem ntau siv rau hauv nplooj ntawv txheej txheem - hauv "pixels":
Kauj ruam 2
Daim HTML tag ntawm lub thav duab nws tus kheej, uas yuav tsum tau muab tso rau hauv lub thawv, yog sau raws li hauv qab no: "src" ntaus cim ntawm "thav duab" cim npe muaj qhov chaw nyob ntawm nplooj ntawv web uas browser yuav ntsaws rau hauv cov ncej no. Ib qho chaw nyob sau ntawv raws li no yog hu ua "tsis muaj tseeb" - nws pib nrog https:// raws tu qauv. Tab sis yog tias qhov no yog nplooj ntawv ntawm koj tus kheej lub vev xaib thiab nws nyob hauv tib (lossis subfolder) nplaub tshev, ces koj tsis tas yuav qhia meej qhov chaw nyob meej, tsuas yog lub npe cov ntaub ntawv thiab cov kev mus rau lub subfolder yuav muaj txaus. Xws li qhov chaw nyob yuav raug hu ua "tus txheeb ze": - Lub ciam teb ntawm thav ntawv hauv nplooj ntawv los ntawm lub neej ntawd tuaj yeem txav nrog nas. Cov yam ntxwv no yog xiam oob qhab los ntawm cov chaw tsis muaj qhov cim cia: - Muaj ob lub cwj pwm uas txiav txim siab qhov loj ntawm cov npoo ntawm cov thav duab - cov kab paj tau teeb tsa cov npoo npoo (sab saum toj thiab hauv qab), thiab cov npoo loj - tav toj (sab xis thiab sab laug): - Siv lwm tus cwj pwm - "scrolling" - koj tuaj yeem qhia txog qhov browser cov cai rau pob ntawm tus ncej: tus nqi "pib" tshwj xeeb hais tias cov ntawv scrollbars yuav tsum tshwm sim raws li xav tau, uas yog, thaum lub ntsiab lus tsis haum rau hauv tus ncej. Yog tias koj teev tus nqi rau "yog", tom qab ntawd cov kablus no yuav ib txwm muaj kab kos rau hauv kab, thiab tus nqi "tsis muaj", ntawm qhov tsis sib xws, tiv thaiv cov zaub ntawm cov ntawv tuav - Yog tias cov nplooj ntawv muaj nyob hauv lub ntim ua haujlwm nrog txhua JavaScript sau ntawv uas ua haujlwm nyob rau hauv cov thav duab uas nyob ib sab, nws yuav tsim nyog kom paub qhov txawv cov thav duab los ntawm lub npe. Cov cwj pwm uas muaj lub npe ntawm tus ncej yog hu ua lub npe:
Kauj ruam 3
Cov ntsiab lus HTML no tau txaus los tsim nplooj ntawv yooj yim ntawm ob peb nplooj ntawv los ntawm lwm qhov chaw. Txhawm rau ua qhov no, koj yuav xav tau ib qho kev sau ntawv xov xwm, piv txwv li ib tus qauv Notepad. Hauv nws, tsim daim ntawv tshiab thiab sau cov ntawv cim npe html no:
Tom qab ntawv khaws cov code no nrog qhov htm lossis html txuas ntxiv - piv txwv li test.html Txhua yam npaj txhij, yog tias koj qhib daim ntawv no nrog tus browser, qhov tshwm sim yuav zoo li no:
Kauj ruam 4
Muaj lwm hom ncej - "ntab". Nws tuaj yeem nyob sab hauv nplooj ntawv tsis tu ncua, tsis faib rau cov thav ntawv. Xws li lub thav duab muaj qhov dav ntxiv thiab qhov siab ntxiv uas txhais tau nws qhov ntev. Cov cai ntawm cov ntawv no yuav zoo li no: