HTML stands for Hypertext Markup Language, and its function is to define and organize the structure of a website through the use of tags. These identify and format different elements of the content’s structure. Why is learning HTML relevant to this course? So that we can create the front-end of the dapps we strive to create through smart contracts.
An HTML tag is added before and after a piece of content of a website (around it) in order to identify it and format it. For example, around the title of the page or around a paragraph. There are also stand-alone tags which don’t require content to enclose, therefore don’t need a closing tag. For example, to include a picture. The combination of both tags and the content are known as an element.
HTML tags look like this: An opening HTML tag has a specified name (e.g. a) which goes between angle brackets (). The closing tag is similar, but adds a slash right after the opening bracket (). Note that stand-alone tag is just like an opening tag. If the tag has attributes, they go right after its name and an empty space. The structure of an attribute is as follows: its name, an equal sign, opening, quotes, its value, and closing quotes. Note that no empty spaces are used (
).
So, what is an attribute? Additional information about an element that you don’t want to be displayed on the final site, or information that modifies that element.
The most basic anatomy of an HTML document is the following: a stand-alone tag that identifies the whole document as HTML; then an opening and closing “html” tag. Nested within it: an opening and closing “head” tag, where other elements for information that affect the whole document but should not be displayed go. After the “head” tag, an opening and closing “body” tag, where the elements that are to be displayed go.