CSS Rules Priority

By Xah Lee. Date: . Last updated: .

Here's CSS rules priority:

  1. Highest priority. CSS embedded in the tag for that tag. For example, <p style="…">.
  2. CSS embedded in the file header for the page. For example, <style type="text/css">…</style>.
  3. The CSS file, for example, <link rel="stylesheet" href="mystyle.css" />. If there's a conflict within the file, the last one rules. And if you want to override the priority, you can put !important, like this p { text-indent: 1em !important }).
Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials