ComputersProgramming

Doctype HTML - yog dab tsi? Yuav ua li cas koj yuav tsum paub txog cov yam khoom

Tsis muaj teeb meem dab tsi lub skeptics, kev kawm tseem yuav ib tug tshwm sim uas yuav tsis tau nres. Txawm li cas los, thaum ib co yog outraged protracted txav mus rau lub hli vaj, lwm leej lwm tus yog cia raus nyob rau hauv ib tug ntshai, vim hais tias nws yuav nyuaj thiab nyuab me ntsis kom mus nrog cov kev hloov. Ib qho piv txwv ntawm xws "catch-up" yog cov neeg sawv cev ntawm professions muaj feem xyuam rau siab technology.

Thaum uas feem ntau web designers, programmers thiab coders yog zoo npaum li cas suited rau cov ntsuj plig ntawm lub sij hawm, es tshaj tej "Nura Baba", uas tau txais ntaub ntawv los ntawm lub lim tiam lig, tiam sis tseem muaj ntau heev distortions, cov kev muaj tiag yog sib txawv dog dig. Xov mus rau theem ntawm kev kawm yog ib qhov nyuaj nyob rau hauv lub tshav pob ntawm tshiab technologies. Xav txog ib tug piv txwv yooj yim: txawm ib co 5-10 xyoo dhau los, ib tug tsim tawm ntawm ua si hauv internet nyob rau hauv tsev av Flash yuav cuag tangible kev vam meej, heev heev "Happy Yawg" yog cov ntawv pov thawj ntawd. Txawm li cas los, hnub no no technology yog maj tuag tawm, muab txoj kev mus rau ib tug ntau niaj hnub, tab sis tsawg tshaj li ib feem ntau ntawm cov kev kawm txog basic HTML5. Los ntawm txoj kev, nws yog HTML5, thiab yog ib tug ntawm cov "cim" ntawm niaj hnub no cov dab neeg mob siab hnub ua hauj lwm HTML-DTP.

Doctype HTML - yog dab tsi?

Qhov no monument rau cov neeg raug ntawm lub high-tech kev kho nyob rau hauv technology. Nqa tej phuam 90-s, uas yog distinguished tsis zoo xwb "kev sib ntaus los" qhov teeb meem nyob rau hauv peb lub teb chaws, tab sis kuj heev ib tug tiag tiag kev tsov kev rog ntawm browsers, coj mus rau hauv lub ntiaj teb no cia li ib tug ob peb khoom uas hais tias tso cai rau computer cov neeg siv kom dej das lub ntiaj teb dav Web. Nws muaj tsuas yog ib qho teeb meem - nrov thaum Netscape Navigator thiab Internet Explorer saib nyob rau tib lub page nyob rau hauv ib tug txawv kiag li, ntsig txog, thiab lub creators ntawm lub site los ua ib tug txawv kiag li cov nplooj ntawv rau cov kev pab cuam.

Standards? Nyob rau hauv cov xyoo, tham txog lawv yog pointless - W3C tau muaj nyob rau hauv nws kiag, thiab txhawb koj IE Microsoft feem ntau paub hais tias nyiam mus txua lawv tus kheej, yog tsis tau tshaj nrog ib yam dab tsi no. Cuaj kaum, los ntawm tus kawg ntawm uas txaus ntshai (rau Web Developers) xyoo caum, qhov teeb meem no xa rov qab mus rau li qub tom qab tag nrho cov: muaj ib co semblance ntawm cov qauv uas yog hais tias tsis tag nrho, tab sis tseem hwm los ntawm tag nrho cov nrov browsers.

Txawm li cas los, qhov teeb meem no muab tau xws li hais tias cov qauv ntawm cov pawg thiab cov browser manufacturers tau, muab tso rau nws mob me, tsis nyob rau hauv tag nrho cov zoo sib xws. Koj yuav tau yooj yim tsim ib tug kiag li lawm nyob rau hauv cov nqe lus ntawm HTML, CSS thiab lub dom page, tab sis koj nyiam browser stubbornly tsom tsis zoo li cas koj yuav tsum tau saib.

Cuaj kaum, raws li lub sij hawm mus rau, developers tseem tau thaum kawg txiav txim siab los xav hais tias tsis tsuas hais txog kev sib tw, tab sis hais txog ib tug webmaster, thiab nws tshwm sim - Doctype HTML. Qhov no yog ib tug tshwj xeeb lossis qhia qhov browser yuav ua li cas nws yuav tsum tau suav hais tias yog kev page.

Yuav ua li cas yuav tsum tau nyob rau hauv lub Doctype HTML-code?

Ua ntej lub advent ntawm txaus qauv, uas pib ua raws li qhov txhia chaw, ntau developers ntawm browsers twb sim mus rub daim pam tshaj nws tus kheej, tsim lawv tus kheej txoj kev mus kom ze rau ib tug technology. Raws li ib tug tshwm sim, ib tug thiab tib page zoo nyob rau hauv txawv browsers nyob rau hauv ntau txoj kev. Txawm li cas los, qhov no peb muaj tau hais, cia li tsis hais tias thaum cov producers ntawm cov kev pab cuam rau Web caij saum nthwv dej tuaj nyob ib ncig ntawm, muaj yog lwm, tsis muaj tsawg txaus luag teeb meem.

Xav txog tej yam qhov teeb meem no: koj - ib tug raug web tsim tawm lig 90s. Nws cia li thiaj li tshwm sim uas feem ntau ntawm cov sij hawm uas koj siv nyob rau hauv qhov browser Internet Explorer 4. Microsoft txiav txim siab mus mam li nco dheev tuaj mus rau lawv tsis totaub thiab ua rau koj tus browser tshiab yog ntau "muaj tseeb", uas nws tsis yog tseeb raws li nws yog tam sim no los tsim qhov chaw thiab yuav ua li cas nrog cov neeg uas muaj twb tsim. Ntawm cov hoob kawm, yog tias koj muaj sij hawm txaus, koj yuav sau dua tshiab nws HTML-code nyob rau hauv xws li ib tug txoj kev uas nws sau raws nkaus Ii mus rau lub qauv tshiab, tab sis vim hais tias cov neeg - tub nkeeg creatures.

Nws yog nyob rau ntawm taw tes Doctype HTML yog lub feem ntau tsim nyog "invention." Nyob ntawm seb dab tsi hom ntawm daim ntawv nws yog teev thaum pib ntawm cov nplooj ntawv, qhov browser yuav xaiv lub feem ntau tsim nyog nyob rau hauv rooj plaub no tus mechanism ntawm rendering. Yog hais tias lub Doctype nyob rau hauv lub HTML-code yog tsis muaj, lub browser yuav mus rau hauv compatibility hom (feem ntau, tiam sis tsis tas). Raws li ib tug tshwm sim, tib Internet Explorer 6 (txawm yog tias cov ntaub ntawv nws so nyob rau hauv kev sib haum xeeb) nyob rau hauv lub qhaj ntawv ntawm Doctype tag behaves li yog hais tias koj ua hauj lwm nyob rau hauv nws cov plaub version.

hom Doctype

Doctype tag muaj xws li ob peb hom uas yuav muab faib ua tej yam no. Firstly, nws piav lub ntsiab hom markup lus: HTML 4.01, HTML 5, XHTML 1.0 los yog XHTML 1.1. Secondly, txhua ntawm cov lus nws muaj nws tswj taw tes rau tus "coefficient ntawm txhaum-nrhiav" t. E. Thaum yuav ua li cas tawv los yuav HTML-code tsim W3C qauv. Txawm li cas los, nyob rau hauv lub thib ob cov ntaub ntawv, uas muaj ob tug zam - HTML5 thiab XHTML 1.1 tsis muaj subspecies thiab tsuas yog ib daim ntawv ntawm Doctype HTML. Tiam sis ntau tshaj nyob rau ntawd tom qab ...

Kawm nyuaj mus kom ze: Doctype nruj

Yog hais tias koj xav kom tsim HTML-code coj mus rau txhua tsab ntawv los ntawm txoj cai validator, ntxiv dej siab (lwm yam tshaj li self-interest) yuav siv Doctype nruj. Yog hais tias koj npaj yuav siv cov advanced XHTML 1.0, txoj kab, uas yuav pib txhua lub caij yuav zoo li no:


Xaiv Doctype HTML Public nruj template kom tej sib txawv los ntawm tus txheej txheem yuav tsum pom los ntawm cov browser, thiab ces siv lub tsis ncaj ncees lawm tag yog tsis quav ntsej li. Nyob rau hauv kev, nyob rau hauv nruj hom, tej tag, seb nws yog ib daim ntawv, duab los yog lwm yam khoom yuav tsum tau yuav tsum tau nyob rau hauv lub thaiv cim npe. Yog hais tias koj txiav txim siab yuav ua li cas tsis muaj nws, cov browser tsuas yuav tsis tso saib cov khoom no, thiab kev ua yuam kev daim ntawv teev layout sau ib ob peb ntawm cov ntaub ntawv.

Nyob rau hauv tas li ntawd, ib tug xov tooj ntawm cov cim npe uas pub rau format cov ntawv nyeem, nws yog tseem ntshaw kom tshem tawm - cov nruj regime implies lub siv CSS.

Siab zoo mus kom ze: Doctype Transitional

Yog hais tias ib tug loj heev txoj kev nruj template tsis nplua koj los yog koj tsuas accustomed mus tawm tsam cov kev cai, muaj yog ib txwm tau mus rau chaw uasi mus rau ib tug ntau siab zoo hom Doctype HTML Public. W3C coj kev kho mob ntawm cov neeg uas tsis xav kom muab lub cwj pwm tsis zoo thiab xav mus ua hauj lwm nyob rau hauv yam tej yam kev mob, tsim ib Transitional qauv sawv cev rau ib txoj kev mus kom ze rau cov qauv validation. Qhov no template enables koj yuav dawb do cia koj tus kheej ib co kev ywjpheej, xws li nruj yog txwv tsis pub, template cim npe, raws li zoo raws li ntau lwm tus le caag los lub layout, uas yog tsis poob tseeb txij thaum lub caij 90s.

«Mos» Doctype HTML 4 yog tshaj tawm hais tias raws li nram no:

Rau XHTML hlua dua nws zoo txawv me ntsis, tab sis lub zuag qhia tag nrho kev sib tseem:

Rau hnub tim, txawm lub fact tias txhua coder thov kom phim lub nruj-template, nws yog ib tug hloov Doctype yog lub nrov tshaj plaws. Cuaj kaum, qhov template muaj ib tug credit txwv: validator yuav "xyeej" tej nplooj ntawv uas muaj ntas. Yog hais tias koj xav tau mus rau chaw uasi rau cov qauv no layout, koj yuav tsum xyuam xim rau cov tom ntej no - lub xeem template.

Los ntawm cov kev mus rau lub kev: Doctype Frameset

Mus kom ze thaum xyuas cov nplooj ntawv ua raws kev cai nrog tus Frameset template yog feem ntau zoo ib yam li hais tias ntawm lub Transitional, txawm li cas los, nyob rau hauv tas li ntawd mus rau lub "kev ywjpheej" ntawm lub saum toj no, qhov no template tso cai rau koj siv ntas. Lwm yam sib txawv Frameset tsis muaj, yog li ntawd, ua tau tsuas yog hloov kab rau kev tshaj tawm, rau HTML 4.01 thiab XHTML 1.0:

Tej-Ntug

Ntawm cov hoob kawm, xa mus rau thaum pib ntawm qhov tsab xov xwm tag nrho cov koob meej loj hlob ntawm HTML5 standard, peb yuav tsis quav ntsej txog markup lus. Nws yog funny uas W3C considers lub yooj yim HTML version, li ntawd, nws yog ib lub Doctype HTML 5 zoo nkaus li zoo heev coj tus. Nyob rau hauv lwm yam lus, hom txhais yog hais tias lub browser yuav tsum tau mus ua hauj lwm nrog "dawb huv» HTML, thiab dab tsi yog hnub no pom tau hais tias yuav lub HTML5, thaum paub rau ntau ntawm cov plaub version yog xav tau uas dhau caij nyoog.

Lwm yam ntau ntau yam Doctype

Rau hnub tim, muaj ntau ntau ntau ntau yam ntawm Doctype qauv, feem ntau ntawm uas los rau XHTML. Thaum lub thib ob version ntawm lub markup lus tsis tuaj tawm mus rau hauv lub teeb, ua ib feem ntawm cov HTML5 aforementioned, variations nyob rau hauv nws cov thawj version, tab sis tsis yog lub siab tshaj plaws loj heev, ciaj sia thiab zoo.

Yog nws tseem ceeb Doctype?

Tej zaum ib txhia novice "sau ntawv" nyob rau hauv lub HTML yuav sim yuav las mees lub advertisement page hom. Zoo, yog hais tias lawv tsis tau kawm ntaub ntawv tseem ceeb los ntawm vyshenapisannogo, peb muab ib tug piv txwv yooj yim. Ntawm no yog ib qho piv txwv nplooj ntawv uas siv Transitional-template:

Nws zoo raws li nws yuav tsum tau saib zoo li nyob rau hauv lub tswv yim ntawm cov designer, tab sis nws yog tsim nyog rau peb kom peb "xav yuam kev» Doctype, thiab peb tau txais rau nram qab no:

Raws li koj tau pom, cov nplooj ntawv tau undergone tseem ceeb cov kev hloov: faded wallpaper, cov zaub mov tau ua disfigured daim ntawv teev, CSS ib co chav kawm ntawv tsuas tsis quav ntsej li, nyob rau hauv tas li ntawd, cov nplooj ntawv "otros" thib ob scrollbar.

Hopefully, qhov no piv txwv yog txaus muaj vyshenapisannogo piav qhov tseem ceeb, yog li ntawd, peb thiaj tsuas kom cov xim los yog, tob, kawm sau cov code uas kis tau nruj-validation. Hmoov zoo rau koj!

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 hmn.birmiss.com. Theme powered by WordPress.