ComputersProgramming

HTML-code. HTML Color Codes

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

Basic information

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

This code consists of tags, through which the browser determines how a particular page looks. Its structure is divided into two parts: head - the title of the document, in which the name of the page is prescribed, 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 learn the tags used by this language, their parameters, and also know the HTML color codes.

Tags

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

The 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. There are two types - paired and single.

Paired ones consist of an opening tag and a closing tag, while in the latter there is a straight slend after the left corner bracket. For example: & lt; b & gt; text & lt; / b & gt ;.

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

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

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

Also note that for most characters: pawls, brackets, trademark, signs greater than or equal to, less than or equal to many others - there is a special table in which the codes for these signs are prescribed. This code starts with an ampersand, after which either an alphabetic mnemonic designation or a lattice sign with a three-digit symbol code can go. In the end, you must put a semicolon.

Basic Tags

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

Paired:

  • & Lt; Body & gt; - contains the main parameters of the document, such as background, link color , 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; - cross out the text;
  • & Lt; Sup & gt; - sets the text as the superscript;
  • & Lt; Sub & gt; - subscript;
  • & Lt; Font & gt; - specifies font attributes: size, font, color;
  • & Lt; Div & gt; - with it, you can align your text;
  • & Lt; H & gt; - header tag;
  • & Lt; A & gt; - it is used to set references;
  • & Lt; Table & gt; - helps to insert tables into the document, with the tags & lt; Tr & gt; (String) and & lt; Td & gt; (cell).

Single:

  • & Lt; br & gt; - single, carries the text following it to a new page;
  • & Lt; hr & gt; - with its help you can insert a horizontal line in 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 himself, but also those who will view the codes in HTML.

Tag parameters

We have already considered with you the main tags that you need to know. Of course, we have listed not all, but even this minimum can be enough to create their first web pages.

But it is not enough to know some tags, you still need to study the parameters that you can specify. In this article we will only make their brief review, we will describe the most frequently used ones. You can see them by opening any HTML-code.

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

  • Face - specifies the type of font;
  • Size - sets the size;
  • Color specifies the color;
  • Align - alignment;
  • Name - name;
  • Href - this parameter specifies the address of the link;
  • Alt - alternative text;
  • Width - width;
  • Height - height;
  • Background - background image;
  • Bgcolor - background.

This is not all the parameters, we listed only the most used and known.

After the parameter, an equal sign is placed, and then its value is written in quotation marks. We advise you when developing websites and pages to use special textbooks or manuals, in order to not only know the basic parameters, but also to set them correctly.

Table of colors

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

Beginner webmasters should know that there are special color tables in which codes of each shade are given. There are only 16 basic colors that can be set not only with the help of a table, but also simply by indicating their name in English. You can also add light and dark words to them, setting the desired hue.

Also there is a table of safe colors, which includes 216 all kinds of outflows.

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

This code is enough to copy and substitute in the parameters of the desired tag.

How to view the page code

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

But how to do that? There are two ways, quite simple and understandable. The first is to open the page you need and press Ctrl + U. In the new window, the source code of the page appears, which you can see 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 you to use the first method, since the use of hot keys is much easier and more convenient.

Note that when reading the code, you will also be able to view the comments to it, written in the "Comment" tag, which looks like this: & lt ;! & Gt; In this case, the comment itself is written after the exclamation mark. It is not displayed in the browser. And it is written, basically, for other programmers and web designers to understand what is behind the block of information below, why this or that piece of code was specified.

conclusions

Writing codes on HTML 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. Studying the basic tags and the principle of markup will not take long. You will have enough even a couple of days to start creating your own projects.

Note that if you decide to study this markup language, then be careful. Most problems arise precisely because of inattention: unclosed paired tags, incorrectly written parameters, typos - all this threatens to turn into a mistake that you can search for long enough. But in general, to study HTML-markup of pages is quite interesting.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.delachieve.com. Theme powered by WordPress.