DEV Community

Rishi
Rishi

Posted on

2 1

One query to remove all CSS at once

3 Types of CSS Styles:

  • Inline
  • External
  • Internal

Most sites have CSS scattered around all these 3 types.

That one query which clears all CSS from a page.

Hit F12 to open the console from the Developer tool.

Alt Text

CtrlC this command:

document.querySelectorAll('style,link[rel="stylesheet"]').forEach(style => style.remove());
Enter fullscreen mode Exit fullscreen mode

Then, CtrlV in the console.
Hit Enter , et Voilà!

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more