Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript.
Web browsers receive HTML documents from a web server or from local storage and render the documents into multimedia web pages. HTML describes the structure of a web page semantically and originally included cues for the appearance of the document.
HTML elements are the building blocks of HTML pages. With HTML constructs, images and other objects such as interactive forms may be embedded into the rendered page. HTML provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. HTML elements are delineated by tags, written using angle brackets. Tags such as <img /> and <input /> directly introduce content into the page. Other tags such as <p> surround and provide information about document text and may include other tags as sub-elements. Browsers do not display the HTML tags, but use them to interpret the content of the page.
HTML can embed programs written in a scripting language such as JavaScript, which affects the behavior and content of web pages. Inclusion of CSS defines the look and layout of content. The World Wide Web Consortium (W3C), former maintainer of the HTML and current maintainer of the CSS standards, has encouraged the use of CSS over explicit presentational HTML since 1997
Development :
1989, Berners-Lee wrote a memo proposing an Internet-based hypertext system.[3] Berners-Lee specified HTML and wrote the browser and server software in late 1990. That year, Berners-Lee and CERN data systems engineer Robert Cailliau collaborated on a joint request for funding, but the project was not formally adopted by CERN. In his personal notes[4] from 1990 he listed[5] "some of the many areas in which hypertext is used" and put an encyclopedia first.
HTML versions timeline
HTML 2
HTML 3
-
- January 14, 1997
- HTML 3.2[15] was published as a W3C Recommendation. It was the first version developed and standardized exclusively by the W3C, as the IETF had closed its HTML Working Group on September 12, 1996.[16]
- Initially code-named "Wilbur",[17] HTML 3.2 dropped math formulas entirely, reconciled overlap among various proprietary extensions and adopted most of Netscape's visual markup tags. Netscape's blink element and Microsoft's marquee element were omitted due to a mutual agreement between the two companies.[13] A markup for mathematical formulas similar to that in HTML was not standardized until 14 months later in MathML.
HTML 4
-
- December 18, 1997
- HTML 4.0[18] was published as a W3C Recommendation. It offers three variations:
- Strict, in which deprecated elements are forbidden
- Transitional, in which deprecated elements are allowed
- Frameset, in which mostly only frame related elements are allowed.
- Initially code-named "Cougar",[17] HTML 4.0 adopted many browser-specific element types and attributes, but at the same time sought to phase out Netscape's visual markup features by marking them as deprecated in favor of style sheets. HTML 4 is an SGML application conforming to ISO 8879 – SGML.[19]
- April 24, 1998
- HTML 4.0[20] was reissued with minor edits without incrementing the version number.
- December 24, 1999
- HTML 4.01[21] was published as a W3C Recommendation. It offers the same three variations as HTML 4.0 and its last errata were published on May 12, 2001.
- May 2000
- ISO/IEC 15445:2000[22][23] ("ISO HTML", based on HTML 4.01 Strict) was published as an ISO/IEC international standard. In the ISO this standard falls in the domain of the ISO/IEC JTC1/SC34 (ISO/IEC Joint Technical Committee 1, Subcommittee 34 – Document description and processing languages).[22]
- After HTML 4.01, there was no new version of HTML for many years as development of the parallel, XML-based language XHTML occupied the W3C's HTML Working Group through the early and mid-2000s.
HTML 5
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.
The Document Type Declaration <!DOCTYPE html> is for HTML5. If a declaration is not included, various browsers will revert to "quirks mode" for rendering
Elements:
HTML documents imply a structure of nested HTML elements. These are indicated in the document by HTML tags, enclosed in angle brackets thus:
<p>
.[71][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 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.
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 coders.
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. Note that 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
Header of the HTML document:
<head>...</head>
. The title is included in the head, for example:
Headings: HTML headings are defined with the
<h1>
to <h6>
tags with H1 being the highest (or most important) level and H6 the least:
Paragraphs:
Line breaks:
<br>
. The difference between <br>
and <p>
is that <br>
breaks a line without altering the semantic structure of the page, whereas <p>
sections the page into paragraphs. The element <br>
is an empty element in that, although it may have attributes, it can take no content and it may not have an end tag.
This is a link in HTML. To create a link the
<a>
tag is used. The href
attribute holds the URL address of the link.
Inputs:
There are many possible ways a user can give input/s like:
Comments:
<h2>Golf</h2>
establishes "Golf" as a second-level heading.<b>boldface</b>
<b>bold</b>
and <i>italic</i>
<strong>strong text</strong>
and <em>emphasized text</em>
img
element is inserted as content into the a
element. Like br
, img
is an empty element with attributes but no content or closing tag. <a href="https://example.org"><img src="image.gif"alt="descriptive text" width="50" height="50" border="0"></a>
.Attributes :
There are several common attributes that may appear in many elements :
- The
id
attribute provides a document-wide unique identifier for an element. This is used to identify the element so that stylesheets can alter its presentational properties, and scripts may alter, animate or delete its contents or presentation. Appended to the URL of the page, it provides a globally unique identifier for the element, typically a sub-section of the page. For example, the ID "Attributes" inhttps://en.wikipedia.org/wiki/HTML#Attributes
. - The
class
attribute provides a way of classifying similar elements. This can be used for semantic or presentation purposes. For example, an HTML document might semantically use the designation<class="notation">
to indicate that all elements with this class value are subordinate to the main text of the document. In presentation, such elements might be gathered together and presented as footnotes on a page instead of appearing in the place where they occur in the HTML source. Class attributes are used semantically in microformats. Multiple class values may be specified; for example<class="notation important">
puts the element into both thenotation
and theimportant
classes. - An author may use the
style
attribute to assign presentational properties to a particular element. It is considered better practice to use an element'sid
orclass
attributes to select the element from within a stylesheet, though sometimes this can be too cumbersome for a simple, specific, or ad hoc styling. - The
title
attribute is used to attach subtextual explanation to an element. In most browsers this attribute is displayed as a tooltip. - The
lang
attribute identifies the natural language of the element's contents, which may be different from that of the rest of the document. For example, in an English-language document:
The abbreviation element,
abbr
, can be used to demonstrate some of these attributes:
No comments:
Post a Comment