Making different parts of a paragraph have different background colors
Not only can you set different elements to have different background colors but in some cases you can even set different parts of an element to have different background colors. For example, paragraphs.
What's the point of making different parts of a paragraph have different background colors?
This concept has many uses, actually. For example, if you want to highlight important keywords of a paragraph for the user or if you want to highlight entire sentences.
The <span> tag
Each part of a paragraph that you want to have a different background color, contain it within a <span> tag. The <span> tag can be used to change the style of something on a page without affecting the context it is within.
The CSS for the paragraph:
HTML stands for Hyper Text Markup Language and it is a language used to create webpages. There are many other web languages out there, but HTML is different. HTML is the core language of the world wide web, the fundamental building block of webpages. Without it, there are no webpages. It all starts with HTML - the simplest but the most important web language. With HTML you make your own pages and decide what text, links, graphics, forms, as well as other elements will appear on them.
Read more about the <span> tag at our HTML div & span tags tutorial.