PickCode Add to Chrome
  1. Home
  2. Guides
  3. Copy a whole section

How do I copy a section from a website with its CSS?

Updated October 29, 2026

Short answer

Copy the section's outerHTML from DevTools, then rebuild its styles from the Styles pane, including the rules for every child. A picker extension like PickCode does both at once and turns the computed styles into Tailwind, React, Blade or HTML + CSS.

Why copying the HTML alone never works

A section on a real site is a tree of elements, and each one is styled by rules spread across several stylesheets: a reset, a framework, component files, utility classes and media queries. When you copy the outerHTML you get the class names, but the rules behind them stay on the other site. Paste it into a blank file and it falls back to browser defaults.

Even if you copy the stylesheets too, you usually get thousands of lines that depend on variables, resets and a different root font size. One Reddit user put it simply: "pasting that into a file… it's not rendering correctly." That is the normal result, not a mistake on your part.

The manual way with Chrome DevTools

This works for small sections and costs nothing. It takes a while for anything bigger than a card.

If you only need the final values for one element, the Console can dump them. Select the node, then run:

const s = getComputedStyle($0);
copy([...s].map((prop) => prop + ': ' + s.getPropertyValue(prop) + ';').join('\n'));

That copies every computed property (several hundred of them), so trim it down to what differs from the defaults before you use it.

The faster way with PickCode

  1. Open the picker. Press Alt Shift C or click Pick an element in the popup.
  2. Select the whole section. Hover a child, then press ↑ until the outline covers the full section. Press Shift to hold it.
  3. Pick a format. Double-click or press Space to open the code panel, then press 1 to 4 for Tailwind, React, Blade or HTML + CSS.
  4. Copy and paste. Copy the code into your project. Hover and focus rules and min-width breakpoints from the page's readable stylesheets come with it.
  5. Add the font. If the section uses a Google Font, copy the font link from the panel too.

What to check before you paste

Honest limits

Any method that reads styles from the browser sees what is applied at your current window size. Rules that live in cross-origin stylesheets can't be read by page scripts, and CSS animations are usually defined in keyframes that are easy to miss. For those, copy the @keyframes block from the Styles pane by hand.

For more on why pasted CSS drifts, see why copied CSS looks different.

Questions

Can I copy a section without the child elements?

In the DevTools route you copy the outerHTML, which always includes children. In PickCode the code panel has an option to copy an element without its children.

Why is the pasted section bigger or smaller than the original?

Usually a different root font size changes every rem value, or a missing font changes line heights. Compare the html font-size and font-family in the Computed tab.

Will the section be responsive?

DevTools gives you whatever rules you copy by hand. PickCode turns min-width media queries it can read into sm:, md: and lg: classes, and keeps clamp(), vw and % values as written.

Is it legal to copy a section from another site?

Learning from structure and styling is common practice, but text, images, logos and distinctive designs can belong to their owners. See is it legal to copy a website design.

Sources

  1. Reddit r/webdev: how to copy a section from a website with its CSS
  2. Reddit r/webdev: how do I copy all the CSS for an element?
  3. Reddit r/Frontend: utilities for copying HTML and CSS styles
  4. Chrome DevTools: view and change CSS
  5. MDN: Window.getComputedStyle()

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

Quick answers