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 }).
Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

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

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Reference
  5. DOM
  6. SVG
  7. Web Dev Blog