rss

HTML - Markups


HTML, A Markup Language

HTML is not a programming language. Rather, it is used for describing the layout and format of content, written in the form of simple text.

An HTML page is a basic text file containing tags for specifying text format, images, etc. The use of these tags is called markup.

How do you use HTML markup?

A tag is a text element (a name) flanked by a less-than sign (<) and greater-than sign (>). For example, "<H1>".

HTML tags are not case-sensitive, meaning that it doesn't matter if they are entered in uppercase or lowercase letters.

HTML tags work in pairs, and affect whichever elements they are surrounding. The first one is called the opening tag, and the second one is called the closing tag. The closing tag begins with a backslash ( / ):

<tag> Your formatted text;  </tag>

For example, the tags <b> and </b> are used to put the text around them in bold letters:

<b> This text is in bold </b>

Some HTML tags are used alone rather than in pairs: the <br> tag, for example, represents a line break.

However, in order to stay as close as possible to the XHTML standard (which is much more strict than standard HTML), the following notation is recommended: <br />.

Nesting Tags

HTML tags can be nested within one another, to allow multiple properties to be applied to the same text. However, overlapping tags are not tolerated by the HTML standard. Here is an example of formatted text with nested tags:

<i><u>How Does It Work</u>, the free IT encyclopedia</i>
The example above gives the following result:
How Does It Work, the free IT encyclopedia
But the example below is incorrect:
<i><b>How Does It Work</i>, the free IT encyclopedia</b>

Attributes

An attribute is an element found within the opening tag that lets you define additional properties. Attributes are most often displayed as a name=value pair, but some attributes may sometimes be defined only by their name.

Here's an example of an attribute for a <p> tag (which defines a paragraph), specifying that the text must be right-aligned:

<p align="right">Example paragraph</p>

Each tag may include one or several attributes, each one with one or several values, or even none.

Spaces, line breaks, and tabs

HTML language disregards spaces, tabs, and line breaks, or more precisely, it considers a string of one or multiple spaces/tabs/line breaks to be a single space. This lets HTML code be indented to be more readable, without changing how the HTML page appears in the browser.

Note: The one exception is for code contained within <PRE> tags, whose very purpose is to keep text formatted (spaces, line breaks, etc.)

The following two portions of HTML code give the same result:

Example of
HTML
code

Example of HTML code

However, HTML has ways of expressly defining each of these layout elements:

  • Non-breaking space: A space which cannot be broken up by the end of a line. Its HTML encoding is &nbsp;.
  • Manual line break: An explicit line break. Its HTML encoding is <br> (<br /> for compliance with XHTML).

Note: The <NOBR> </NOBR> tag does the opposite, preventing the browser from breaking up a line automatically!

Comments

Information can be added to a web page without being shown on the screen, with a special set of tags called comment tags.

<!-- This is a comment -->

Comment tags are for commenting on text but can also be used to comment on the HTML code itself.

Note: The one exception is for code contained within <PRE> tags, whose very purpose is to keep text formatted (spaces, line breaks, etc.).

This document entitled « HTML - Markups » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.
 
Tips & Tricks relevant found in the knowledge base
16/03 16h37[Viruses] Preliminary method of disinfectionViruses
13/05 23h27Formatting articles of the knowledge baseFAQ
More tricks on « HTML tag »
Relevant topic found in the forum
17/06 04h58How to view emal messages sent in HTML0
20/05 20h50HTML Code "mailto:_____" issues3
02/05 13h15Cannot send HTML email in Outlook3
09/04 17h26Cleanup Unused CSS Tags?2
30/03 13h15TAG SWITCHING1
More discussions about « HTML tag »
Software found in the relevant downloads
Download PC Inspector File Recovery 4.0PC Inspector File Recovery - PC INSPECTORâ„¢ File Recovery is a data recovery program that supports the FAT 12/16/32 and NTFS file systems. Finds...Category: Backup
License: Freeware/gratuit
Download Money Manager Ex 0.9.2.0Money Manager Ex - Possibilty to download a version compatible with Linux <h2> </h2> Money Manager Ex is a free, open-source, cross...Category: Budget
License: Open Source
More freeware about « HTML tag »