PickCode Add to Chrome
  1. Home
  2. Answers
  3. Why copied CSS breaks

Why does CSS copied from a website look different on my page?

Updated October 29, 2026

Short answer

Because the rules you copied were never the whole story. The original element also inherits fonts and colors from its parents, sits on top of a CSS reset, may size things in rem against a different root font size, and can depend on CSS variables, web fonts and media queries that did not come along.

The usual causes

How to check it in DevTools

  1. Open DevTools on the original page, select the element and switch to the Computed tab. These are the final values the browser used.
  2. Do the same for your pasted element and compare the properties that differ, starting with font, line height, padding and width.
  3. Turn on Show all in Computed to see inherited values, and click the arrow next to a value to jump to the rule that set it.
  4. Check the html element's font size on both pages if anything uses rem.

A quick fix for inherited text styles is to set them on the root of what you pasted:

.pasted-card {
  font-family: Inter, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1c1917;
  box-sizing: border-box;
}

The faster way

PickCode starts from the computed styles, so inherited values, inline styles and CSS-in-JS come through with the element. It keeps CSS variables with their fallback, includes the web font and copies the Google Fonts link, and adds the page's own :hover and breakpoint rules from stylesheets it can read. In our end-to-end tests the pasted code rendered at the original size at 390, 900 and 1280px wide. It can't read cross-origin stylesheets or animations yet, so check those by hand.

Full walkthrough: Copy CSS in DevTools

Questions

Why does my copied CSS look right in CodePen but not in my app?

CodePen starts from browser defaults. Your app has a reset, global styles and maybe a framework, so look for rules in your own CSS that override the pasted ones.

Should I copy computed styles or the original rules?

Computed styles reproduce what you see at one screen size. Original rules keep relative units and media queries. The best result uses computed values as the base and adds the hover and breakpoint rules on top.

Why are the fonts different?

The font file probably is not loaded on your page. Add the same web font, or check its license if it is a paid font.

Sources

  1. Reddit r/webdev: copied CSS not rendering correctly
  2. MDN: Window.getComputedStyle()
  3. MDN: Specificity
  4. Chrome DevTools: View and change CSS

Copy it in one click

PickCode turns any element into Tailwind, React, Blade or HTML + CSS. Free for 5 elements a day.

Add to Chrome

Related