How to insert color into html. How to change font color in HTML using Mozilla Firefox web browser? How to change the background color

There are various design issues to deal with when creating a web page. One of the most common questions is how to change the color of text in HTML. It is quite simple to solve it, and there are two different ways.

Setting an inline text style attribute

To understand how to change the color of text in HTML, just look at the list of attributes text box... Among them there are a number of values ​​that determine the style of the text enclosed in these tags, which are indicated inside keyword style.

To change the color of the text, it is enough to enter the word style = "" in the selected area of ​​the text field inside the opening tag. Inside this attribute, you can specify various parameter values ​​- the value of the color attribute is responsible for changing the color shade of the text. By specifying this parameter, after the colon, you must specify the color in which all characters will be painted of this field... In this case, when defining a hue, you can specify both an explicit color value, for example, red or yellow, and its hexadecimal value, or rgb.

Regardless of the chosen method of determining the color, the result will be the same in the case of the same choice of shade. Thus, all of the following three examples will make the same changes to the text - they will color it yellow.

1.

text

2.

text

3.

text

Change color using CSS

Using a style sheet also allows you to decide how to change the color of the text in HTML. CSS is fully supported by everyone modern versions HTML, and also allows you to change the style of several page elements at once.

To understand how to change the color of text in HTML from using CSS, it is not necessary to understand the formal language of defining the appearance. To define the attributes of some element, you need to create a CSS description, which is written inside the tag , and is defined by the tag