HTML elements

HTML elements

We are going to discuss the basics of HTML to make sure the fundamentals are right— beginning with what HTML is for and how it works. I’ll define the basic terminology HTML uses and show you some of the core HTML elements that pretty much every web page uses.

I like <code>apples</code> and oranges.

The element is shown in bold—it has three parts. The start tag is <code>, and the end tag is </code>. Between the tags is the element’s content (in this case, the word apples). Together, the tags and the content form the code element.

Elements are the way you tell the browser about your content. The effect of the element is applied to the element contents. Each of the HTML elements has a different and quite specific meaning—the code element, for example, represents a fragment of computer code.

Inline vs block-level elements

By default, inline elements do not force a new line to begin in the document flow. Block elements, on the other hand, typically cause a line break to occur.

Some inline elements:

span, i, b, strong, u, a, img, input

Some block level elements:

h1…h6, form, div, table, li, ul, p