0% found this document useful (0 votes)
3 views2 pages

6

HTML markup consists of tags, attributes, and document structure, with elements typically defined by paired start and end tags. The document type declaration is essential for proper rendering, and HTML elements can contain nested tags and attributes. Certain elements are self-closing, and the structure of HTML allows for inferred closures of tags based on context.

Uploaded by

Bhushan Mahajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

6

HTML markup consists of tags, attributes, and document structure, with elements typically defined by paired start and end tags. The document type declaration is essential for proper rendering, and HTML elements can contain nested tags and attributes. Certain elements are self-closing, and the structure of HTML allows for inferred closures of tags based on context.

Uploaded by

Bhushan Mahajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Markup

HTML markup consists of several key components, including those called tags (and
their attributes), character-based data types, character references and entity
references. HTML tags most commonly come in pairs like <h1> and </h1>, although
some represent empty elements and so are unpaired, for example <img>. The first tag
in such a pair is the start tag, and the second is the end tag (they are also
called opening tags and closing tags).

Another important component is the HTML document type declaration, which triggers
standards mode rendering.

The following is an example of the classic "Hello, World!" program:

<!DOCTYPE html>
<html>
<head>
<title>This is a title</title>
</head>
<body>
<div>
<p>Hello world!</p>
</div>
</body>
</html>
The text between <html> and </html> describes the web page, and the text between
<body> and </body> is the visible page content. The markup text <title>This is a
title</title> defines the browser page title shown on browser tabs and window
titles and the tag <div> defines a division of the page used for easy styling.
Between <head> and </head>, a <meta> element can be used to define webpage
metadata.

The Document Type Declaration <!DOCTYPE html> is for HTML5. If a declaration is not
included, various browsers will revert to "quirks mode" for rendering.[72]

Elements
Main article: HTML element

HTML element content categories


HTML documents imply a structure of nested HTML elements. These are indicated in
the document by HTML tags, enclosed in angle brackets thus: <p>.[73][better source
needed]

In the simple, general case, the extent of an element is indicated by a pair of


tags: a "start tag" <p> and "end tag" </p>. The text content of the element, if
any, is placed between these tags.

Tags may also enclose further tag markup between the start and end, including a
mixture of tags and text. This indicates further (nested) elements, as children of
the parent element.

The start tag may also include the element's attributes within the tag. These
indicate other information, such as identifiers for sections within the document,
identifiers used to bind style information to the presentation of the document, and
for some tags such as the <img> used to embed images, the reference to the image
resource in the format like this: <img src="example.com/example.jpg">

Some elements, such as the line break <br> do not permit any embedded content,
either text or further tags. These require only a single empty tag (akin to a start
tag) and do not use an end tag.
Many tags, particularly the closing end tag for the very commonly used paragraph
element <p>, are optional. An HTML browser or other agent can infer the closure for
the end of an element from the context and the structural rules defined by the HTML
standard. These rules are complex and not widely understood by most HTML authors.

The general form of an HTML element is therefore: <tag attribute1="value1"


attribute2="value2">''content''</tag>. Some HTML elements are defined as empty
elements and take the form <tag attribute1="value1" attribute2="value2">. Empty
elements may enclose no content, for instance, the <br> tag or the inline <img>
tag. The name of an HTML element is the name used in the tags. The end tag's name
is preceded by a slash character, /, and that in empty elements the end tag is
neither required nor allowed. If attributes are not mentioned, default values are
used in each case.

Element examples
See also: HTML element
Header of the HTML document: <head>...</head>. The title is included in the head,
for example:

<head>

You might also like