Tags, Elements and Attributes
HTML (and XML) is a format that generally follows the following conventions
- raw data in the form of text (this is the default)
- "metadata" (i.e. information or specifications or other data related to the main data but generally not meant to be seen, but interpreted)
Most often, the raw data is set off and specified by opening and closing tags; which comprise an element, in the following manner:
<tag> raw data </tag>
Some tags "self-close", e.g.
Additionally, elements may contain "attributes," extra bits of information, e.g.
<tag attribute="extra bit"> raw data </tag>
Before CSS, HTML mixed "semantic" and "visual" tag types for elements, but for HTML5, the goal generally is to have HTML be semantic, and CSS be visual. E.g. — instead of the <i> for "italics" , <em> for "emphasis" is preferred (a semantic description of what the text is supposed to be like, not a visual descriptor.
Also, note that most elements we encounter will be "block" elements (wherein the text inside will be considered a self contained "block") — Note that this is how html sets "chunks" of text apart from one another, NOT through whitespace (e.g. tabs, spaces, etc.) That is, any space or spaces or newlines NOT set off by tags will be reduced to one space, always.
And a good reference : https://www.w3schools.com/html/default.asp