Colors and Styling in HTML

Colors and Styling in HTML

Basics of color formats and styling in HTML

Introduction

HTML is the basic language used to create web pages. HTML elements can be styled using CSS. In this blog, we will discuss a few more HTML elements, colors, and a little bit about CSS.

Colors

Colors can be defined in HTML using various methods such as hex value, hsl value, rgb value, and hwb value. The most commonly used methods are hex, hsl, and rgb. RGB values define the amount of red, blue, and green present in that color, and the values of these individual colors can vary from 0 to 256. HSL values define the amount of hue, saturation, and light present in that color and can vary from 0 to 360. Sometimes alpha is used after RGB and HSL, which defines the transparency of that color and varies from 0 to 1.

Ways to inject styling: Styling can be injected in HTML in different ways such as by defining inline CSS in the tags, by defining the style tag in the head section of HTML, or by making a totally different file naming .css file. We can link this page in the head tag by using the link tag. The priority of injecting styling is the last value that is defined to that element.

Quotations

In HTML, quotations can be written using the p tag, but the p tag does not give much importance. We can use the blockquote tag to give more importance to quotes or citations. We can use the cite attribute of this tag to define citations. We can also use the q tag to write quotes, but it is not commonly used. The abbreviation tag is used to write abbreviations, and the cite tag is used to define the title of a creative work. We use the bdo or by-directional tag to define the direction of reading.

Conclusion

In this blog, we have discussed various methods to define colors and ways to inject styling in HTML. We have also discussed different HTML tags to define quotations and abbreviations. By using these tags and methods, we can create web pages that are aesthetically pleasing and easy to read.