HTML wrapper - the HTML tag
The html tag tells the browser, "this file is written using the HTML markup langauge".
Therefore, we wrap our HTML documents in it to ensure the browser knows what it's doing.
This tag is essential for every website so that the computer knows what it is looking at, and in most cases it comes at the very beginning of the source code and ends at the very end of it. For example, open a text editor (If you're on Windows, Notepad is fine) and write like this:
<html lang="en">
Hello, world!
</html>
Once you've written this, save it as helloworld.php, or any similar filename. When you open this file in the browser, it should say "Hello" in black text, or whatever is the default on your browser.
This is the most basic tag in a website. When you are on the internet, you can see websites decorated with all sorts of flashy images and moving parts and bold personalities, but all of them start and end with <html> and end with </html>.
The lang part is just telling the computer what language the page is in. To be honest, this is more use to search engines than to humans, but it's good practice anyway. Use a different two-letter country code if your page is not in English. You can make websites in any language, after all.
DOCTYPE declaration
[Example]
<!DOCTYPE html>
These days, you don't have to tell the browser what exact specification of the HTML language your website was written in. There used to be many different versions of HTML, but now we have one standard, HTML5. You just have to tell your browser that you're using HTML and it will interpret the rest. Neat, right?
The DOCTYPE declaration is written above the <html> tag. A basic website should have the following going on:
<!DOCTYPE html>
<html>
<head>
...
</head>
<body>
...
</body>
</html>
Remember to put the DOCTYPE declaration at the very top of the page so your browser is extra sure it's reading HTML code. Now we can learn about the <head> tag!