Inject CSS with chrome developer tool?

前端 未结 8 855
忘了有多久
忘了有多久 2020-12-13 18:40

Where can I add CSS to the page I\'m viewing? I don\'t want to add style to one element directly, I want to add a \'document\' to a page to debug changes before editing the

8条回答
  •  温柔的废话
    2020-12-13 19:18

    Why not a kind of simple framework agnostic one-liner like this?

    document.body.appendChild(function() {var el = document.createElement('link'); el.setAttribute('rel', 'stylesheet'); el.setAttribute('href', 'http://domain/print.css'); return el;}())
    

    Seems to work like a charm...

提交回复
热议问题