CSS priorities

There are priorities in CSS files. When there are multiple elements coming from multiple stylesheets, from multiple CSS sources, there are priorities.

In ascending order of priority, from lowest to highest, you have:

  • Browser default properties
  • External stylesheets
  • Internal stylesheets
  • Inline styles

The highest priority goes to inline styles, which is actually what we recommend you use.

Otherwise, you have the !important declaration, which means it is possible to override all these priorities by using the !important value.

For example:

h1 { font-style: bold !important; }

Here, this means that h1 can be defined in an inline, internal, or external stylesheet โ€” it doesn't matter. With the !important declaration, h1 will always be displayed in bold because the priority of !important is the highest.

Les prioritรฉs CSS

Conclusion

In this article, you learned how to define your CSS code, meaning the presentation associated with the HTML tags of your page.

You can manage this code directly in your HTML page or, better yet, in a separate file. And you can also add links between different CSS files.


There you go, now you can show off at parties...

We have some courses on sale at the Itamde web school: https://itamde.com/en/online-courses/

You can also find us on YouTube:

Here => https://www.youtube.com/channel/UCZ4dhshzpVbbRPVuL9TNH4Q

Or here => https://www.youtube.com/channel/UCQlKs3ToaL8IKRbXtwtFnyA

Recent Posts

Recent Comments

"

Itamde is also an online programming school.

Itamde

Learn what you want, at your own pace

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

You may also be interested in...

The essential SEO plugins for WordPress

The essential SEO plugins for WordPress

The SEO plugins that actually matter for WordPress โ€” SEO suite, cache, images, redirects โ€” and how to combine them without slowing your site.

Pointers in C and C++ explained simply

Pointers in C and C++ explained simply

Understand pointers in C and C++ without the stress: memory addresses, dynamic allocation, common pitfalls and good habits, explained step by step.

Stay up to date with the latest news and developments

Access restricted content

Discover behind-the-scenes details of our projects, exclusive resources, and the progress of our creations in real time.

Sign up for our newsletter

Receive our news, creative insights, and updates from the studio directly in your inbox.

Follow us

Join our community on social media to follow our daily projects and interact with us.