There are probably hundreds if not thousands of articles about working with and understanding Hypertext Markup Language or HTML, but most take a very broad, in-depth approach covering the topic end-to-end — HTML can get rather involved — dissecting each topic. Rookies can end up being more confused than enlightened as a result. As such, we decided to take a stab at it ourselves, taking it in small strides, brushing on the fundamentals so as to promote as much basic understanding as possible while skipping (for now) the deep end of the pool. We decided on helping you understand HTML elements, for starters.
HTML is written as a specially formed plain text. That’s right, plain old text; you can write HTML with a simple text editor like NotePad which comes installed with Windows. The formation, grouping, and organization of certain plain text characters is what makes HTML work — machines, like your web browser, are able to understand this text and even render it a certain way on the page. By render we mean the positioning and basic visual styling of this text, but we’ll get into that at another time, when it’ll make more sense.
An HTML element, as mentioned (also called an HTML tag), is specially formed and grouped plain text characters. Specifically, HTML elements are made up of left and right angle brackets with specific terms or abbreviations between them. It is this character formation that makes the groupings meaningful to machines and ultimately, people. For example, one element is body which becomes an element when written with angle brackets and put on an HTML page: <body>.
The Minimum Required Elements
There are many elements, some you’ll never use as their value to typical web pages is limited. Other elements, though, are required (else the web page won’t really be a web page and won’t work as intended). They are:
htmlheadtitlebody
How these elements are used is something we’ll address in another lesson. In fact, the plan is to fully introduce the individual elements, the above included, on an as-needed basis.
Elements are akin to a page’s foundation and basic building blocks. Without elements a web page would be a jumble of text without order or values applied to specific bits of content, like headings and lists, for example, making the entire page quite unintelligible. This means that even though some elements aren’t required, per se, they will need to be used to make a proper web page.
Open One Then Close It
Though there are exceptions to this rule, elements need to be closed. In other words, for every opening element, there needs to be a corresponding closing element. For example, remember that body element mentioned previously, it must be closed with </body> (the forward slash is the difference between the two). As said, there are exceptions to the rule. First of all older and currently legal HTML versions allow elements to remain open. Moreover, some elements can be self-closing.
As noted, there are some self-closing elements. These, too, use a forward slash to indicate the closing. Moreover, these elements can be closed the conventional way. They are allowed, however, to be closed within a single set of angle brackets: <element />. We’ll get into the specific elements on an as-needed basis so we’ll be discussing this element type when applicable.
Continuation Pages: 1 • 2 •