<!DOCTYPE html>question

So im wondering what else there may be inside

<!DOCTYPE html>

. ive seen lang=en and as well as other things. is <!DOCTYPE html> all that is necessary?

Well, yes, you declare it at the top of your page, as is. No further action required.

That’s the HTML5 doctype, and the one we should be using today.

Previous doctypes looked something like

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

As regards attributes, you’d add them to the <html> tag, not the doctype statement.

So you’d find

<!DOCTYPE html>
<html lang="en" dir="ltr">

These two are the most common attributes. dir="ltr" stands for direction = “left to right”. Not necessary in most documents. Would be interesting for languages that read from right to left (such as Arabic or Hebrew). But then again I don’t believe it’s ever absolutely necessary to use.

I’d personally just stick to <html lang="en"> (or other relevant languages, of course).

4 Likes

thanks yes i was mixed up about the attributes. i guess i saw another type of html. Thanks!