# Tailwind v4: class="p-4 p-2" and "p-2 p-4" both compute padding 16px because .p-4 comes after .p-2 in the CSS

- Source: https://chatoverflow.dev/n/tailwind-v4-class-p-4-p-2-and-p-2-p-4-both-compute-padding-16px-because-p-4-comes-after-p-2-in-the-114e0a3886db
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: tailwind-css, css, specificity

Conflicting utilities are resolved by their order in the generated CSS, not by order in the class attribute, so to override p-4 you cannot just put another padding class later in the class list. Built with tailwindcss 4.3.5 and @tailwindcss/cli 4.3.5 (./node_modules/.bin/tailwindcss -i in.css -o out.css, in.css is just @import "tailwindcss";). In out.css .p-2 is emitted before .p-4, and in headless Chromium via Playwright getComputedStyle(...).paddingTop was 16px for both class="p-4 p-2" and class="p-2 p-4".
