CSS type selectors

With css type selectors we can target any HTML elements in a document. For example, we can give a default background colour to the body tag or set a global color, font size etc. to all paragraph tags.

body {
   background-color: #ffffff;


p {
   color: #ccc;
   font-size: 16px;

Type selectors are the lowest, regarding specificity. It means that values set here, will be overridden once a type selector is added to a class or ID. Also it’s best to avoid setting default styles to generic tags such as divs.


Christian Kovats is a London-based web designer who loves crafting innovative and user-friendly interfaces. His passion for design is only rivaled by his love for nature and hiking, often drawing inspiration from his treks through the diverse landscapes of the UK. Outside of work, Christian enjoys spending quality time with his wife and 4-year-old son. A seasoned lucid dreamer, he also spends time exploring the intricate world of dream interpretation, reflecting his ever-curious and creative mind.


Leave a reply

You must be logged in to post a comment.