HTML according to some sources is not an actual programming language; it is apparently a markup language. Nevertheless, html it turns out is quite as important as the other "legit" programming languages. Infact, all the webpages on the internet are written in html, this is because, html or markup languages are the only languages web browsers can read.
HTML is an acronym for HyperText Markup Language. Where hypertext refers to texts that link to other resources on the web; resources such as videos, other webpages or websites.
These are special words or characters wrapped in angle brackets < > that are used to specify the attributes of content on a webpage. Tags in html often start with an opening or starting tag which looks like this <a> and end with a closing or end tag which looks like this </a>. Note that I said most, that means some html tags do not have a closing tag; we'd get to them soon.
Void or empty tags are tags in html that do not require a closing or end tag. They are called empty tags, because they do not have any content at all. They perform specific tasks. Common examples of void tags are <br> and <img>. When they are used in html, there is no need to attach a closing tag, they'd work just fine.
Now, there are some tags such as the <p> tag for whom closing tags are optional.
These tags have content, but they are also block tags, hence your browser automatically understands that this is what happens when I see this tag. Now this is only applicable when you start another of these kind of tags.
<p> Hello, this is an example. <p>For a blog post on html.
Your browser will read this as two paragraphs same way as if you used closing tags at the end of each paragraph.
In html, any space, tab or line breaks in your html text is known as white space. The unique thing about white spaces is that browsers would completely disregard or compress any and all whitespace(s) in your html text to a single space. Is this a good thing? I think this is a great feature because it allows for the developer to organise his/her code without affecting the end result.
There are certain elements that cannot be nested inside others. I call them the big dogs. Apparently, in html there is a pecking order, and this is used to determine the hierarchy in which elements are nested. So if you nest a â€œbig dog tag/elementâ€ in a smaller one, it is a syntax error. <ol> should not be nested in say <li>.
When nesting elements, ensure that every tag you open is closed in a symmetrical order. Kind of like a reverse order; close tags in reverse of how they were opened. For instance, <ol> <li> an example </li> </ol>.
Block elements are html elements that organise their content in blocks. They have top, bottom and side margins. Attributes can be assigned to block elements and they will affect the entire block of their content.
Unlike block elements, inline elements do not separate their content from other contents on the web page using margins. That means, they do not have margins. Inline elements flow with the rest of the content on a web page. Therefore, they cannot be used to format a block of content on a web page.