HTML stands for HyperText Markup Language. It is the standard markup language to create webpages. Web browsers can read HTML files and render them into visible or audible web pages. On this web page there are some HTML basics to help you understand HTML better and how it works. Before we start, you need to understand the difference between CSS and HTML.
HTML is a language for describing web pages.
CSS defines how to display HTML elements.
Tag | Description |
---|---|
<html> ... </html> | Declares the web page to be written in HTML |
<head> ... </head> | Delimits the page's head |
<title> ... </title> | Defines the title (not displayed on the page) |
<body> ... </body> | Delimits the page's body |
<hn> ... </hn> | Delimits a level n heading |
<b> ... </b> | Set ... in boldface |
<i> ... </i> | Set ... in italics |
<center> ... </center> | Center ... on the page horizontally |
<ul> ... </ul> | Brackets an unordered (bulleted) list |
<ol> ... </ol> | Brackets a numbered list |
<li> ... </li> | Brackets an item in an ordered or a numbered list |
<br> | Forces a line brake here |
<p> | Starts a paragraph |
<hr> | Inserts a horizontal rule |
<img src="..."> | Displays an image here |
<a href="..."> ... </a> | Defines a hyperlink |
| Non-breaking space |
Validate your code and use markup according to its purposes. For validation there are validators, and both syntax and semantics are explained in specifications. Many advantages spring out of respecting syntax and semantics. Most notably, avoiding a few accessibility pitfalls and being professional.
Avoid presentational and behavioral elements and attributes, avoid presentational and behavorial ID and class names, avoid linking off to too many style sheets and scripts, avoid screwing up file names, &c. pp. Markup changes continue to be most expensive. Separation of concerns is the only option you have to write markup that is reusable and maintainable.
Leave everything out that is not absolutely necessary. Question everything. Just using the markup you really need sounds easy but, unfortunately, it's not. It requires experience and expertise. When questioning everything and omitting even more, look into syntactical opportunities, too (protocol-less URLs, optional tags, unquoted attribute values, &c.). Once comfortable with the techniques, welcome not only performance but also maintainability benefits.
You can check out the video below for some HTML basics if you're too lazy to read this stuff that I wrote above: