i

Learn HTML and CSS in 10 Days

Adding Colour To Text

The niche of web typography has seen a great advancement with time. There are several reasons linked with its rise in popularity. One of the reasons behind this is the establishment of a framework for embedding our web fonts on a website.

In the earlier time, we were provided with a limited amount of typefaces that can be used on a website. These typefaces were the most popular fonts that were installed on the computers. Thus, there was a high chance of rendering them properly on-screen. If a font is absent in the computer, it won't get processed on the website either. But now we have a much wide range of palette of typefaces to select from.

While the capacity to implant text styles gives us access to incalculable new typefaces, it is recommended for us to get accustomed to some of the fundamental principles of typography. This section is all about some of the fundamental principles as well as techniques to introduce them into our web pages with the help of HTML and CSS.

Adding Color to Text

One of the very first and important decisions that everyone will make while making up a website is selecting the basic text color as well as the typeface. Several properties can be varied, like weight, size, etc. but the text color and the typeface provides the greatest impact on the legibility and look of a web page. Getting away with the pre-defined value of the browser and providing our text color and typeface quickly starts establishing the pace of our page.

The only property required to provide color to the text is the ‘color’ property. This property takes in one value for color but in several formats. You can check Chapter 3, where we have discussed a lot about them. Let’s just see an example here.

html {

  color: #555;

}