banner
Welcome to HTML.co.uk, the number one resource for all news, information, and happenings regarding HTML.

Updates: HTML.co.uk has just been relaunched. Subscribe to our RSS Feed to stay on top of HTML news and techniques.
May
6th

Non-displayed Text (Commentary)

Author: Editor | Files under HTML Basics, HTML Tutorials
Tags for this article: , , , ,

HTML includes the possibility to enter commentary anywhere you please inside a HTML file. The commentary is then ignored by the web browsers and not shown in the presentation. Commentaries make sense to give internal information regarding the author and date, or to make internal notices next to certain areas of text, or to comment on which HTML tags were used.

An Example:

<h1>Welcome!</h1>

<!– Commentary: the above element is a heading –>

<A lot of text</p>

<!–and that is a multi-lined commentary on the text with <p>…</p>
The last line of commentary –>

Explanation:

Commentaries are entered using the <!– order of characters. Afterwards one can enter as much commentary as they desire. You can also notate HTML elements inside a commentary. Everything in between the introductory character combination and the ending –> combination will be ignored by the browser. However, specially marked commentaries, such as so-called conditional comments, are interpreted by Internet Explorer.

Take Note:

The character combination – - already starts and ends the commentary. When you strongly wish to accentuate a commentary and wish to use special characters as a dividing line, then it is best not to use the minus sign -, and instead to use another character, such as the equal sign = or the star *.

While tinkering with your HTML file you will inevitably experiment with and test many different variants. Sometimes it is helpful to not erase previous solutions with a new solution before testing, and instead save the old solution inside a commentary. This area is then deactivated for the browser, but can also easily be reactivated. Then you don’t have to get upset when you overwrite something that was actually better than what you just replaced it with.

Credits

You should pay attention to the following tips if you wish to produce HTML files for the web.

  • Declare yourself responsible as the website producer:
    Make sure to note who produced the website. Users have the right to know who is responsible for producing a website.
  • Display the date of production:
    Write the date of production in a suitable place in the text. This is especially important with information that quickly becomes obsolete. For example, a price list for PC hardware that hasn’t been updated for over two years, will quickly reveal its usefulness with a clearly displayed date of production.
  • Declare your copyrights:
    Declare your copyrights or clearly state what can and cannot be done with your text. You can hardly forbid the copying of text, but you can stop the further dissemination of your text even with changes made to it. Be sure to also specify your copyrights for all graphics, logos etc.
  • Allow for the possibility of feedback:
    You could include your email or a feedback form, for example.

May
6th

Defining Colour in HTML

Author: Editor | Files under HTML Basics, HTML Tutorials
Tags for this article: , , , ,

Colours can be defined in many different contexts in HTML, for example:

  • File wide background colours
  • Font colours for blocks of text
  • Background colours in tables

Although all these designations have since been characterised as deprecated by the W3 consortium, which means they should no longer belong to the language standard in the future. The reason is that all of these colours can be defined with the help of style sheets. CSS, not HTML, is now the language for graphics. Nevertheless, it is worth learning how to define these colours in HTML, because although the same functions exist in CSS, the language also has many more possibilities. We will discuss the subject from a CSS viewpoint in a later section.

There are fundamentally two possibilities for defining colour in HTML:

  • Choose the desired colour in hexadecimal form through designations of RGB values (RGB= red/green/blue)
  • Through the designation of a colour name

If you enter hexadecimal inputs, then you work independently of the browser, and you have the total freedom of choosing from 16.7 million colours.

If you choose to simply the enter the colour name, then you bypass the somewhat complicated method of defining a colour in the hexadecimal mode. However, there are currently only 16 standardised colours. Additional colour names exist, but they are browser dependent.

The hexadecimal entry of colours

If you wish to define colours directly in the hexadecimal mode, then you must select the desired colour from designations for the three base colours, red, green and blue.

An Example:

<body bgcolor= “#808080”> <!– dark grey file background –>
<table bgcolor= “#00C0C0”> <!– blue green table background –>
<hr color= “#CC00CC”> <!– violet divider –>

Explanation:

Every hexadecimal colour definition has six digits and follows the formula: #RRGGBB

First notate a “#”. Six characters then follow and define the colour. The first two define the red value of the colour, the second two define the colour’s green value, and the final two define the colour’s blue value.

Hexadecimal Digits:

0 (corresponds to the decimal 0)
1 (corresponds to the decimal 1)
2 (corresponds to the decimal 2)
3 (corresponds to the decimal 3)
4 (corresponds to the decimal 4)
5 (corresponds to the decimal 5)
6 (corresponds to the decimal 6)
7 (corresponds to the decimal 7)
8 (corresponds to the decimal 8 )
9 (corresponds to the decimal 9)
A (corresponds to the decimal 10)
B (corresponds to the decimal 11)
C (corresponds to the decimal 12)
D (corresponds to the decimal 13)
E (corresponds to the decimal 14)
F (corresponds to the decimal 15)

Therefore, a hexadecimal digit can have 16 different conditions.

Take Note:

There are 16 base colours that can be displayed by every VGA compatible screen

There are also 216 colours, which have developed into the internet’s standard colour palette. We will discuss these colour palettes in greater detail in a separate section.

In order to make defining colours easier, colour selectors also exist.

Names for the basic 16 colours

An Example:

<body bgcolor= “black”> <!– black file background –>
<table bgcolor= “aqua”> <!–light blue table background –>
<hr color= “red”> <!– red divider –>

Enter the desired colour names in the place where colour designations are allowed.
In order to get an overview of the available colours, you can enter the example above. The hexadecimal values, that correspond to colour names, will then be shown.


May
5th

Rules for Text Input and Editing HTML

Author: Editor | Files under HTML Basics, HTML Tutorials
Tags for this article: , , , ,

If you use a text editor or source text oriented HTML editor to produce HTML files, then you should know and pay attention to the following rules:

  • Pay attention to the masking regulations for HTML unique characters, special characters and the entire character set.
  • Order line breaks and blank lines in such a way as to provide an optimal overview for the source text. Also make sure that line breaks and new paragraphs aren’t displayed the same way by the web browser, as they are entered into the source text. For line breaks and paragraph breaks to appear in the internet browser, you have to use the corresponding paragraph or line break HTML elements. If for some special reason you wish for everything entered in the source code to be displayed in exactly the same way by the web browser, you may use the HTML element for pre-formatted text.
  • Remember that there are no tabs in HTML. A tab entered in the source code will be changed into an empty space by the web browser. Line break characters, tab characters and space characters in HTML make up the so-called white space characters. The browser typically interprets a tab or line break in the HTML source text as an empty space. Multiple consecutive white space characters are ignored and fused together as only one single empty space character. Instead of actually pressing the space bar, you may instead enter the &#160; character combination into the source code to produce an empty space; and do so as many times in a row as desired.