This forum is now read-only. Please use our new forums at discuss.codecademy.com.

HTML Basics Forum

View Course » View Exercise

127 points
5158ec7692c9d690200005af_1982246
Submitted by
Johnny
about 4 years ago

<!DOCTYPE html> what the capital letters?

I'm curious as to why the word doctype is capitalized or needs to be capitalized in the <!DOCTYPE html> tag?

Will the tag not work properly if it is written in lower case letter?


4 votes

permalink

Hello,
I think it is capitalized to emphasize that this line is the doctype and that this line is very important.
However, the doctype is case-insensitive, so you could write it in lowercase, if you wanted to.
But I suggest doing it the way it is taught here at CC, as the official documents use the capitalized doctype.
=> You can write it the way you want, but I recommend writing it in uppercase letters.
I hope it helps. :-)

3108 points
5154c6cf115b457ac9000021_667301409
Submitted by
boring12345
about 4 years ago

2 Comments

49114e24b595c478aa28ae0e40274446?s=140&d=retro Samuel Lim about 4 years ago

I think the computer only recognises capital letters, But it confirm works if you use capitals, so just use it.

519d1c15be660a76be00022c_64613546 Francis Pang about 4 years ago

@Samuel: i think that a normal browser will render a doctype in lowercase in HTML file, but it will not do so in XHTML.


3 votes

permalink

Just thought I would share some extra info that I read. Apparently if you are coding in any xml serializations such as XHTML, then the DOCTYPE has to be capitalized otherwise it will throw a syntax error. I read this on a forum somewhere so don't know if there is any truth to it, but if anyone knowledgeable in this area can shed any light on this, it would be much appreciated :)

610 points
Picture
Submitted by
Richard Walker
about 4 years ago

1 Comment

5154c6cf115b457ac9000021_667301409 boring12345 about 4 years ago

Perhaps try it: http://validator.w3.org/


0 votes

permalink

DOCTYPE, along with most other html elements, does not care about case. This is for emphasis.

1206 points
Fb6f13fcbef596b703d337caf56196d0?s=140&d=retro
Submitted by
Joel.Miles925
over 2 years ago


0 votes

permalink

As I know, it's for emphasize.

388 points
Be2986960142593c0b2b51bb69e10070?s=140&d=retro
Submitted by
MIke YI
over 2 years ago