List of links for CSS

Internet Explorer Chrome Opera Safari Firefox Android iOS
4.0+ 1.0+ 4.0+ 1.0+ 1.0+ 1.0+ 1.0+


Determine the color of links to different areas of the web page.


Links of different colors usually need to be placed on the page that has several
different areas of the base color. On a dark background logically placed
links in light colors, and a light, by contrast, dark-colored links.

To separate different style links management will consider two ways. The first
is based on a contextual selector. The meaning is as follows. Menu links are located
within a block, for example,

... , and referenced in the text
within the block
... . Then the style for different
turn such references.

Recording .menu A means that the style is defined only for the selector
A , which is located inside an element with class menu (see Example 1).

EXAMPLE 1 Using Context selectors


  Использование контекстных селекторов

The result of this example is shown in Fig. one.

Links that differ in color

Fig. 1. Links that differ in color

The second way is to use classes. For reference, the color of which is necessary to
define a new class is created and added to the tag (Example 2).


EXAMPLE 2 Using classes


  Использование классов

Ссылка 1 | Ссылка 2 | Ссылка 3

Ссылка 1 | Ссылка 2 | Ссылка 3

How to link to the site in HTML

To create a link you need to tell the browser which is a
reference, as well as specify the address of the document to which you want to make a
link. Both actions are performed using the tag ,
which is the only required attribute the href .
The value is the document address (URL).

Link address can be absolute or relative. Absolute addresses work
everywhere irrespective of the name of the site or web page where the link is registered.
They begin to specify the data transfer protocol. So, for your web pages is
usually HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), respectively,
absolute references begin with the keyword http: //
(Example 1).

Example 1. Using absolute references

  Абсолютная ссылка

Поисковая система Яндекс

Relative references as their name implies, are built with respect to
the current document or address.

Examples of relative addresses


These two links are called incomplete, and point the Web server to load
the index.html file (or default.html), which is in the root of the site
or the demo folder. If an index.html file is not available, the browser usually
displays a list of files in this directory.


slash before the address says that addressing starts from the root
of the site. The link leads to drawing pic.gif, which is located in the folder
images. And that, in turn, is placed in the site root.

Two points before the name indicates the browser to go to a higher level
in the list of directory sites.


If the front of the folder name do not have any additional characters, such as points,
then it is placed in the current directory (example 2).

Example 2. Using relative references

  Относительная ссылка

Посмотрите на мою фотографию!

Как сделать такое же фото?

Sometimes you can find in the address reference path as a ./file/doc.html .
Point with a slash (/ character) means that, counting from the current folder. Such
recording is redundant and can be cut to the file / doc.html .

Read in other languages

 BelorussianEnglish Deutsch Spanish French Italian Portuguese Turkish Arab Ukrainian Swedish Hungarian Bulgarian Estonian Chinese (Simplified) Vietnamese Romanian Thai Slovenian Slovak Serbian Malay Norwegian Latvian Lithuanian Korean Japanese Indonesian Hindi Hebrew Finnish Greek Dutch Czech Danish Croatian Chinese (Traditional) Philippine Urdu Azeybardzhansky ArmenianPolish Bengal Georgian Kazakh Catalan Mongolski Russian Tadzhitsky Tamilʹskij telugu Uzbetsky

Add a comment

Your e-mail will not be published. Required fields are marked *