Is the code that a user writes in order to create a document to display on the web?


HTML is the standard markup language for creating Web pages.


What is HTML?

  • HTML stands for Hyper Text Markup Language
  • HTML is the standard markup language for creating Web pages
  • HTML describes the structure of a Web page
  • HTML consists of a series of elements
  • HTML elements tell the browser how to display the content
  • HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link", etc.

A Simple HTML Document

Example

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h2>My First Heading</h2>
<p>My first paragraph.</p>

</body>
</html>

Try it Yourself »

Example Explained

  • The <!DOCTYPE html> declaration defines that this document is an HTML5 document
  • The <html> element is the root element of an HTML page
  • The <head> element contains meta information about the HTML page
  • The <title> element specifies a title for the HTML page (which is shown in the browser's title bar or in the page's tab)
  • The <body> element defines the document's body, and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
  • The <h2> element defines a large heading
  • The <p> element defines a paragraph

What is an HTML Element?

An HTML element is defined by a start tag, some content, and an end tag:

<tagname> Content goes here... </tagname>

The HTML element is everything from the start tag to the end tag:

<h2>My First Heading</h2>

<p>My first paragraph.</p>

Start tagElement contentEnd tag
<h2> My First Heading </h2>
<p> My first paragraph. </p>
<br> none none

Note: Some HTML elements have no content (like the <br> element). These elements are called empty elements. Empty elements do not have an end tag!



Web Browsers

The purpose of a web browser (Chrome, Edge, Firefox, Safari) is to read HTML documents and display them correctly.

A browser does not display the HTML tags, but uses them to determine how to display the document:

Is the code that a user writes in order to create a document to display on the web?


HTML Page Structure

Below is a visualization of an HTML page structure:

<html>

<head>

<title>Page title</title>

</head>

<body>

<h2>This is a heading</h2>

<p>This is a paragraph.</p>

<p>This is another paragraph.</p>

</body>

</html>

Note: The content inside the <body> section (the white area above) will be displayed in a browser. The content inside the <title> element will be shown in the browser's title bar or in the page's tab.


HTML History

Since the early days of the World Wide Web, there have been many versions of HTML:

YearVersion
1989 Tim Berners-Lee invented www
1991 Tim Berners-Lee invented HTML
1993 Dave Raggett drafted HTML+
1995 HTML Working Group defined HTML 2.0
1997 W3C Recommendation: HTML 3.2
1999 W3C Recommendation: HTML 4.01
2000 W3C Recommendation: XHTML 1.0
2008 WHATWG HTML5 First Public Draft
2012 WHATWG HTML5 Living Standard
2014 W3C Recommendation: HTML5
2016 W3C Candidate Recommendation: HTML 5.1
2017 W3C Recommendation: HTML5.1 2nd Edition
2017 W3C Recommendation: HTML5.2

This tutorial follows the latest HTML5 standard.



Source code is the fundamental component of a computer program that is created by a programmer. It can be read and easily understood by a human being. When a programmer types a sequence of C programming language statements into Windows Notepad, for example, and saves the sequence as a text file, the text file is said to contain the source code. 

Source code and object code are sometimes referred to as the "before" and "after" versions of a compiled computer program. For script (noncompiled or interpreted) program languages, such as JavaScript, the terms source code and object code do not apply, since there is only one form of the code.

Programmers can use a text editor, a visual programming tool or an integrated development environment (IDE) such as software development kit (SDK) to create source code. In large program development environments, there are often management systems that help programmers separate and keep track of different states and levels of source code files. 

Licensing of source code

Source code can be proprietary or open, and licensing agreements often reflect this distinction.

When a user installs a software suite like Microsoft Office, for example, the source code is proprietary, and Microsoft only gives the customer access to the software's compiled executables and the associated library files that various executable files require to call program functions.

By comparison, when a user installs Apache OpenOffice, its open source software code can be downloaded and modified. 

Typically, proprietary software vendors like Microsoft don't share source code with customers for two reasons: to protect intellectual property and to prevent the customer from making changes to source code in a way that might break the program or make it more vulnerable to attack. Proprietary software licenses often prohibit any attempt to discover or modify the source code.

Open source software (OSS), on the other hand, is purposely designed with the idea that source code should be made available because the collaborative effort of many developers working to enhance the software can, presumably, help make it more robust and secure. Users can freely take open source code under public licenses, such as the GNU General Public License.

Purposes of source code

Beyond providing the foundation for software creation, source code has other important purposes, as well. For example, skilled users who have access to source code can more easily customize software installations, if needed.

Meanwhile, other developers can use source code to create similar programs for other operating platforms -- a task that would be trickier without the coding instructions.

Access to source code also allows programmers to contribute to their community, either through sharing code for learning purposes or by recycling portions of it for other applications.

Organization of source code

Many different programs exist to create source code. Here is an example of the source code for a Hello World program in C language:

/* Hello World program */

#include<stdio.h>

main()
{
printf("Hello World");

}

Even a person with no background in programming can read the C programming source code above and understand that the goal of the program is to print the words "Hello World." In order to carry out the instructions, however, this source code must first be translated into a machine language that the computer's processor can understand; that is the job of a special interpreter program called a compiler -- in this case, a C compiler.

After programmers compile source code, the file that contains the resulting output is referred to as object code.

Object code consists mainly of the numbers one and zero and cannot be easily read or understood by humans. Object code can then be "linked" to create an executable file that runs to perform the specific program functions.

Source code management systems can help programmers better collaborate on source code development; for example, preventing one coder from inadvertently overwriting the work of another.

History of source code

Determining the historical start of source code is a subjective -- and elusive -- exercise. The first software was written in binary code in the 1940s, so depending on one's viewpoint, such programs may be the initial samples of source code.

One of the earliest examples of source code as we recognize it today was written by Tom Kilburn, an early pioneer in computer science. Kilburn created the first successful digital program held electronically in a computer's memory in 1948 (the software solved a mathematical equation).

Is the code that a user writes in order to create a document to display on the web?
Tom Kilburn's highest factor routine

In the 1950s and '60s, source code was often provided for free with software by the companies that created the programs. As growing computer companies expanded software's use, source code became more prolific and sought after. Computing magazines prior to the internet age would often print source code in their pages, with readers needing to retype the code character for character for their own use. Later, floppy disks decreased the price for electronically sharing source code, and then the internet further deleted these obstacles.

This was last updated in September 2019

Continue Reading About source code

  • The value of running security analysis tools against source code
  • Learn how various computer languages work
  • How to properly use open source libraries
  • How a source code strategy can help with automating version control

Dig Deeper on Application development and design

  • Is the code that a user writes in order to create a document to display on the web?
    compiler

    Is the code that a user writes in order to create a document to display on the web?

    By: Robert Sheldon

  • Is the code that a user writes in order to create a document to display on the web?
    build

    Is the code that a user writes in order to create a document to display on the web?

    By: Katie Terrell Hanna

  • Is the code that a user writes in order to create a document to display on the web?
    runtime

    Is the code that a user writes in order to create a document to display on the web?

    By: Ben Lutkevich

  • Is the code that a user writes in order to create a document to display on the web?
    Rust rises in popularity for cloud-native apps and environments

    Is the code that a user writes in order to create a document to display on the web?

    By: Zachary Flower