Basic elements of HTML
Basic elements of HTML
Using HTML, a text file is further marked up with additional text describing how the document
should be displayed. To keep the markup separate from the actual content of the HTML file,
there is a special, distinguishing HTML syntax that is used. These special components are known
as HTML tags. The tags can contain name-value pairs known as attributes, and a piece of content
that is enclosed within a tag is referred to as an HTML element.
HTML elements always have opening tags, content in the middle and closing tags. Attributes can
provide additional information about the element and are included in the opening tag. Elements
can be described in one of two ways:
1. Block-level elements start on a new line in the document and take up their own space.
Examples of these elements include headings and paragraph tags.
2. Inline elements do not start on a new line in the document and only take up necessary
space. These elements usually format the contents of block-level elements. Examples of
inline elements include hyperlinks and text format tags.