--- layout: post title: "HTML Syntax" subtitle: "As any language, HTML has rules" section: html --- **HTML** stands for **H**yper**T**ext **M**arkup **L**anguage: * **HyperText** means that it uses the HTTP part of the Internet * **Markup** means the code you write is annotated with keywords * **Language** means it can be read by both a human and a computer Like any language, HTML comes with a set of **rules**. These rules are relatively simple. It comes down to defining **boundaries**, to know where something _starts_ and where something _ends_. Here is a sample paragraph in HTML: {% highlight html %}
If Tetris has taught me anything it's that errors pile up and accomplishments disappear.
{% endhighlight %}If Tetris has taught me anything it's that errors pile up and accomplishments disappear.
`{:.language-html} defines the **start** of the paragraph * the _closing_ tag `
`{:.language-html} defines its **end** The only difference between an opening and closing tag is the **slash** `/`{:.language-html} that precedes the name of the tag. When you combine an opening tag, a closing tag, and everything in between, you obtain an **HTML element**. The whole line is an HTML element that uses the HTML tags ``{:.language-html} and `
`{:.language-html}. If you [view this sample in your browser](/html/sample-paragraph.html), you'll notice that **HTML tags are not displayed** by the browser. They are only _read_ by the browser to know what _type_ of **content** you've written. ### Where to write HTML You've probably come across simple text files, those that have a `.txt` extension. For such a text file to become an **HTML document** (instead of a text document), you need to use an `.html` extension. Open your **text editor**, and copy paste the following: {% highlight html %}This is my firstwebpage!
{% endhighlight %} Save this file as `my-first-webpage.html` and just open it with your browser, and you'll see:This is my firstwebpage!
Hello World!
{% endhighlight %}Hello World!