HTML code HTML color codes

Surely you came across a concept such as HTML code. Heard from friends, seen in the menu of your browser, etc. But what is it? Let's try to figure out what kind of code it is and what elements it consists of.

html code

Basic information

Let's start with the definition. HTML code - markup of any web page that is made using the HTML language.

This code consists of tags, thanks to which the browser determines how this or that page looks. Its structure is divided into two parts: head - the title of the document in which the name of the page is written, as well as information about the document itself, and body - the body of the document in which the page parameters are set.

In order to create a more or less decent web page written from scratch, you should study the tags used by this language, their parameters, and also know the HTML color codes.

Tags

html color codes

The tag is an element of the HTML language. With it, you can set the font, color, size of the text, insert tables and pictures into it, format, create headings, links, and also colorize the page.

Tags are always enclosed in angle brackets - <>, and this is what distinguishes them from the main text, which is displayed on the page when viewed. They are of two types - paired and single.

Pairs consist of an opening tag and a closing one, while in the last one there is a direct slash after the left angle bracket. For example: & lt; b & gt; text & lt; / b & gt ;.

Between the two tags is a text, table, picture or other element, which is displayed on the web page.

Single ones consist of one tag and do not contain a forward slash. For example: & lt; hr & gt ;.

Tags can have parameters that can be set using special codes for HTML.

Also note that for most characters: dogs, brackets, trademark, signs greater than or equal to, less than or equal to many others - there is a special table in which the codes of these signs are written. This code begins with an ampersant, after which it can either be its letter mnemonic designation, or the lattice sign with a three-digit character code. At the end, a semicolon is required.

Main tags

What is the HTML code, we figured it out, now try to list the main tags that can be useful if not when creating your own web pages, then at least in the design of texts.

Paired:

  • & lt; body & gt; - contains the main parameters of the document, such as background, color of links, fields and others;
  • & lt; p & gt; - indicates a paragraph;
  • & lt; b & gt; - highlights the text in bold;
  • & lt; i & gt; - italics;
  • & lt; u & gt; - emphasizes the text;
  • & lt; s & gt; - crosses out the text;
  • & lt; sup & gt; - sets the text as a superscript;
  • & lt; sub & gt; - subscript;
  • & lt; font & gt; - sets font parameters: size, font, color;
  • & lt; div & gt; - with it, you can align your text;
  • & lt; h & gt; - header tag;
  • & lt; a & gt; - with its help links are set;
  • & lt; table & gt; - helps to insert tables into a document, tags associated with it & lt; tr & gt; (string) and & lt; td & gt; (cell).

html codes

Single:

  • & lt; br & gt; - single, transfers the text following it to a new page;
  • & lt; hr & gt; - with it, you can insert a horizontal line into the text.

It is worth noting that tags are usually written from a new line. This is done for the convenience of not only the layout designer, but also those who will view the codes in HTML.

Tag Parameters

We have already examined with you the main tags that you would like to know. Of course, we have listed far from everything, but even this minimum may be enough to create our first web pages.

But it’s not enough to know some tags, you still need to study the parameters that can be set. In this article, we will only briefly review them and describe the most commonly used ones. You can see them by opening any HTML code.

We will also not describe for which tag this parameter is suitable, since many of them are used in most web markup commands:

  • face - sets the type of font;
  • size - sets the size;
  • color - sets the color;
  • align - alignment;
  • name - name;
  • href - using this parameter sets the address of the link;
  • alt - alternative text;
  • width - width;
  • height - height;
  • background - background image;
  • bgcolor - background.

These are far from all the parameters; we have listed only the most used and known ones.

An equal sign is placed after the parameter, and then its value is written in quotation marks. When developing websites and pages, we recommend that you use special textbooks or manuals so that you not only know the basic parameters, but also set them correctly.

Color chart

codes for html

So, with the main tags and their parameters, we figured out, now let's look at the HTML color codes. It is with their help that you can specify the coloring of the text, page, or its individual elements.

Novice webmasters should be aware that there are special color tables that provide codes for each shade. There are only 16 basic colors that can be set not only using the table, but simply by indicating their name in English. You can also add words light and dark to them, setting the desired shade.

There is also a table of safe colors, which has 216 all kinds of edemas.

Note that using tables is much more convenient. They are given a hexadecimal color code. In this case, you can immediately see this shade. Each code begins with a pound sign, followed by three pairs of characters characterizing the intensity of the primary colors: red, green and blue.

It is enough to copy this code and substitute it into the parameters of the tag you need.

How to view page code

html codes

If you are interested in creating web pages, then you will probably be interested to see the HTML code of the site that you like, or the one you visit quite often.

But how to do that? There are two ways, quite simple and straightforward. The first is to open the page you need and press the key combination Ctrl + U. The source code of the page will appear in a new window, which you can view and study.

The second way is to click the left mouse button and select the "Source Code" item in the drop-down list . But still we recommend that you use the first method, since the use of hot keys is much simpler and more convenient.

Note that by reading the code, you can also view the comments on it written in the "Comment" tag, which looks like this: & lt ;! & gt ;. In this case, the comment itself is written after the exclamation point. It does not appear in the browser. And it is written mainly so that other programmers and web designers can understand what kind of information block is below, why a particular piece of code was indicated.

conclusions

html site code

Writing HTML codes is not as difficult as it might seem at first glance. Especially if you are unpretentious and want to create unpretentious websites, electronic textbooks based on HTML, etc. Learning the basic tags and the principle of markup does not take much time. You only need a couple of days to start creating your own projects.

Note that if you decide to learn this markup language, then be careful. Most of the problems arise precisely because of inattention: unclosed pair tags, incorrectly written parameters, typos - all this threatens to turn into an error that you can search for a long time. But in general, learning HTML markup is pretty interesting.


All Articles