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

Patreon me $5. Ask me question on patreon