Html5 doctype tshaj tawm yog dab tsi?
Html5 doctype tshaj tawm yog dab tsi?

Video: Html5 doctype tshaj tawm yog dab tsi?

Video: Html5 doctype tshaj tawm yog dab tsi?
Video: HTML5 для начинающих / Урок #13 – Создание HTML форм и полей для ввода 2024, Kaum ib hlis
Anonim

To taub cov HTML5 Doctype

Hom ntaub ntawv Tshaj tawm , los yog DOCTYPE luv luv, yog ib qho kev qhia rau lub web browser txog version ntawm markup lus nyob rau hauv uas ib tug web page yog sau. A DOCTYPE tshaj tawm tshwm nyob rau sab saum toj ntawm nplooj ntawv web ua ntej tag nrho lwm cov ntsiab lus.

Yog li ntawd, yog doctype tshaj tawm tsim nyog hauv html5?

A DOCTYPE yog xaiv tau rau HTML5 cov ntaub ntawv hauv XHTML syntax (piv txwv li, XHTML5 cov ntaub ntawv): XML cov ntaub ntawv yuav muaj a DOCTYPE yog tias xav tau, tab sis qhov no tsis yog xav tau kom ua raws li qhov tshwj xeeb no. A DOCTYPE yog xav tau rau HTML5 cov ntaub ntawv hauv HTML syntax: A DOCTYPE.

Tom qab ntawd, lo lus nug yog, koj yuav ua li cas thiaj ua tau tus doctype hauv HTML? Cov doctype Daim ntawv tshaj tawm Saib mus rau nplooj ntawv no "Source Code". Qhov chaws code yog tus HTML uas tsim ib nplooj ntawv. Ntawm lub PC hauv Chrome lossis FireFox txoj nyem nyem qhov twg ntawm nplooj ntawv (tshwj tsis yog cov tshaj tawm) thiab xaiv "Saib nplooj ntawv qhov chaw", lossis txawm yooj yim dua tsuas yog nyem "Ctrl-U".

Yog li ntawd, dab tsi ua <! Doctype html txhais li cas?

A doctype lossis hom ntawv tshaj tawm yog ib qho kev qhia uas qhia lub web browser txog cov lus cim uas nyob rau nplooj ntawv tam sim no yog sau. Cov Doctype yog tsis yog ib qho khoom lossis tag, nws cia tus browser paub txog cov version ntawm lossis tus qauv ntawm HTML los yog lwm yam lus markup uas yog siv rau hauv cov ntaub ntawv.

Nws puas tsim nyog sau doctype hauv HTML?

peb yuav tsum ib txwm siv a DOCTYPE rau txhua tus browser raws li Nws qhia tus browser yuav txhais li cas html thiab css. Cov <! DOCTYPE > kev tshaj tawm yuav tsum yog thawj qhov hauv koj HTML cov ntaub ntawv, ua ntej lub < html > tag.

Pom zoo: